迁移order service 代码
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评价
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-14 20:00:00
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 好评
|
||||
*/
|
||||
private Integer positiveTotal;
|
||||
|
||||
/**
|
||||
* 中评
|
||||
*/
|
||||
private Integer moderateTotal;
|
||||
|
||||
/**
|
||||
* 差评
|
||||
*/
|
||||
private Integer negativeTotal;
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 用户的真实姓名
|
||||
*/
|
||||
private String userNickName;
|
||||
|
||||
/**
|
||||
* 评价星
|
||||
*/
|
||||
private Integer star;
|
||||
|
||||
/**
|
||||
* 评论的内容
|
||||
*/
|
||||
private String commentContent;
|
||||
|
||||
/**
|
||||
* 评论的图片地址
|
||||
*/
|
||||
private String commentPics;
|
||||
|
||||
/**
|
||||
* 回复条数
|
||||
*/
|
||||
private Integer replayCount;
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer collectCount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论创建
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-19 18:32
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentCreateBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单评论 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 评论详情和商家评论回复
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-03 20:30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentInfoAndMerchantReplyBO {
|
||||
|
||||
/**
|
||||
* 评论详情
|
||||
*/
|
||||
private OrderCommentInfoBO orderCommentInfoBO;
|
||||
|
||||
/**
|
||||
* 商家评论回复
|
||||
*/
|
||||
private List<OrderCommentMerchantReplyBO> orderCommentMerchantReplyBOS;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单回复评价详情
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-16 18:40
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentInfoBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String userNickName;
|
||||
|
||||
/**
|
||||
* 评价星
|
||||
*/
|
||||
private Integer star;
|
||||
|
||||
/**
|
||||
* 评论的内容
|
||||
*/
|
||||
private String commentContent;
|
||||
|
||||
/**
|
||||
* 评论的图片地址
|
||||
*/
|
||||
private String commentPics;
|
||||
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeCount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 商品 sku id
|
||||
*/
|
||||
private int productSkuId;
|
||||
|
||||
/**
|
||||
* 商品 sku 属性
|
||||
*/
|
||||
private String productSkuAttrs;
|
||||
|
||||
/**
|
||||
* 商品 sku 价格
|
||||
*/
|
||||
private String productSkuPrice;
|
||||
|
||||
/**
|
||||
* 商品 sku 地址
|
||||
*/
|
||||
private String productSkuPicUrl;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
*
|
||||
* 商家评论回复
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-03 19:30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentMerchantReplyBO {
|
||||
|
||||
/**
|
||||
* 商家评论回复
|
||||
*/
|
||||
private String replyContent;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论分页展示
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-14 20:00:00
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
// 评论标签化等等在做
|
||||
// /**
|
||||
// * 好评
|
||||
// */
|
||||
// private Integer positiveTotal;
|
||||
//
|
||||
// /**
|
||||
// * 中评
|
||||
// */
|
||||
// private Integer moderateTotal;
|
||||
//
|
||||
// /**
|
||||
// * 差评
|
||||
// */
|
||||
// private Integer negativeTotal;
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
private List<OrderCommentItem> orderCommentItems;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@AllArgsConstructor
|
||||
public static class OrderCommentItem{
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 用户的真实姓名
|
||||
*/
|
||||
private String userNickName;
|
||||
|
||||
/**
|
||||
* 评价星
|
||||
*/
|
||||
private Integer star;
|
||||
|
||||
/**
|
||||
* 评论的内容
|
||||
*/
|
||||
private String commentContent;
|
||||
|
||||
/**
|
||||
* 评论的图片地址
|
||||
*/
|
||||
private String commentPics;
|
||||
|
||||
/**
|
||||
* 回复条数
|
||||
*/
|
||||
private Integer replayCount;
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeCount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 商家回复列表
|
||||
* 只展示最近的一条
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单回复创建
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-19 18:35
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentReplyCreateBO implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 评论回复 id
|
||||
*/
|
||||
private Integer id;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 评论回复分页展示
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-19 14:19
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentReplyPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 评论回复总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 用户回复
|
||||
*/
|
||||
List<OrderCommentReplayItem> orderCommentReplayItems;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderCommentReplayItem{
|
||||
/**
|
||||
* 回复 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 回复的类型
|
||||
*/
|
||||
private Integer replyType;
|
||||
|
||||
/**
|
||||
* 回复的内容
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
/**
|
||||
* 回复的用户 id
|
||||
*/
|
||||
private int replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户的真实姓名
|
||||
*/
|
||||
private String replyUserNickName;
|
||||
|
||||
/**
|
||||
* 回复用户的头像
|
||||
*/
|
||||
private String replyUserAvatar;
|
||||
|
||||
/**
|
||||
* 回复的点赞数
|
||||
*/
|
||||
private int replyCollectCount;
|
||||
|
||||
/**
|
||||
* 回复目标用户昵称
|
||||
*/
|
||||
private String parentUserNickName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论状态详情分页(这么设计因为这个接口需要登陆以后才能看到所以与订单分页接口分开)
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-07 10:39
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentStateInfoPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* (待/已)评论总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 评论状态
|
||||
*/
|
||||
private List<OrderCommentStateInfoItem> orderCommentStateInfoItems;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderCommentStateInfoItem{
|
||||
|
||||
/**
|
||||
* 订单 id
|
||||
*/
|
||||
private Integer orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 商品 id
|
||||
*/
|
||||
private Integer productSpuId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productSpuName;
|
||||
|
||||
/**
|
||||
* 商品 sku id
|
||||
*/
|
||||
private Integer productSkuId;
|
||||
|
||||
/**
|
||||
* 商品 sku 属性
|
||||
*/
|
||||
private String productSkuAttrs;
|
||||
|
||||
/**
|
||||
* 商品 sku 价格
|
||||
*/
|
||||
private Integer productSkuPrice;
|
||||
|
||||
/**
|
||||
* 商品 sku url
|
||||
*/
|
||||
private String productSkuPicUrl;
|
||||
|
||||
/**
|
||||
* 订单评论状态
|
||||
*/
|
||||
private Integer commentState;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.order.biz.bo.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 订单评论超时
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-15 13:52
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentTimeOutBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计算订单价格结果 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CalcOrderPriceBO {
|
||||
|
||||
/**
|
||||
* 商品分组数组
|
||||
*/
|
||||
private List<ItemGroup> itemGroups;
|
||||
/**
|
||||
* 优惠劵编号
|
||||
*/
|
||||
private Integer couponCardId;
|
||||
/**
|
||||
* 优惠劵减少的金额
|
||||
*
|
||||
* 1. 若未使用优惠劵,返回 null
|
||||
* 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。
|
||||
*/
|
||||
private Integer couponCardDiscountTotal;
|
||||
/**
|
||||
* 邮费信息
|
||||
*
|
||||
* TODO 芋艿,暂时未弄
|
||||
*/
|
||||
private Postage postage;
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
private Fee fee;
|
||||
|
||||
/**
|
||||
* 商品分组
|
||||
*
|
||||
* 多个商品,参加同一个活动,从而形成分组。
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class ItemGroup {
|
||||
|
||||
/**
|
||||
* 优惠活动
|
||||
*/
|
||||
// TODO 芋艿,目前只会有【满减送】的情况,未来有新的促销方式,可能需要改成数组
|
||||
private PromotionActivityBO activity;
|
||||
/**
|
||||
* 促销减少的金额
|
||||
*
|
||||
* 1. 若未参与促销活动,或不满足促销条件,返回 null
|
||||
* 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。
|
||||
*/
|
||||
private Integer activityDiscountTotal;
|
||||
/**
|
||||
* 商品数组
|
||||
*/
|
||||
private List<Item> items;
|
||||
// /**
|
||||
// * 费用
|
||||
// *
|
||||
// * TODO 芋艿,这里先偷懒,postageTotal 字段用不到。
|
||||
// */
|
||||
// private Fee fee; // 注释原因,不用这里了
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Item extends ProductSkuDetailBO { // TODO 芋艿,此处先偷懒继承
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private Boolean selected;
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
private Integer buyQuantity;
|
||||
/**
|
||||
* 优惠活动
|
||||
*/
|
||||
private PromotionActivityBO activity;
|
||||
/**
|
||||
* 原始单价,单位:分。
|
||||
*/
|
||||
private Integer originPrice;
|
||||
/**
|
||||
* 购买单价,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 最终价格,单位:分。
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 购买总金额,单位:分
|
||||
*
|
||||
* 用途类似 {@link #presentTotal}
|
||||
*/
|
||||
private Integer buyTotal;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
/**
|
||||
* 最终总金额,单位:分。
|
||||
*
|
||||
* 注意,presentPrice * quantity 不一定等于 presentTotal 。
|
||||
* 因为,存在无法整除的情况。
|
||||
* 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。
|
||||
* 所以,需要存储一个该字段。
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 费用(合计)
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Fee {
|
||||
|
||||
/**
|
||||
* 购买总价
|
||||
*/
|
||||
private Integer buyTotal;
|
||||
/**
|
||||
* 优惠总价
|
||||
*
|
||||
* 注意,满多少元包邮,不算在优惠中。
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
/**
|
||||
* 邮费 TODO 芋艿,将 postage 改成 logistics
|
||||
*/
|
||||
private Integer postageTotal;
|
||||
/**
|
||||
* 最终价格
|
||||
*
|
||||
* 计算公式 = 总价 - 优惠总价 + 邮费
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
|
||||
public Fee() {
|
||||
}
|
||||
|
||||
public Fee(Integer buyTotal, Integer discountTotal, Integer postageTotal, Integer presentTotal) {
|
||||
this.buyTotal = buyTotal;
|
||||
this.discountTotal = discountTotal;
|
||||
this.postageTotal = postageTotal;
|
||||
this.presentTotal = presentTotal;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮费信息
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Postage {
|
||||
|
||||
/**
|
||||
* 需要满足多少钱,可以包邮。单位:分
|
||||
*/
|
||||
private Integer threshold;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单 page
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 14:30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 购买(商品)总金额,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountPrice;
|
||||
/**
|
||||
* 物流金额 (分)
|
||||
*/
|
||||
private Integer logisticsPrice;
|
||||
/**
|
||||
* 最终金额,单位:分
|
||||
*
|
||||
* buyPrice + logisticsPrice - discountPrice = presentPrice
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 实际已支付金额,单位:分
|
||||
*
|
||||
* 初始时,金额为 0 。等到支付成功后,会进行更新。
|
||||
*/
|
||||
private Integer payAmount;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 付款时间(待发货)
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间(待收货)
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间(已签收)
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(用户确认收货 -> status = 已完成)
|
||||
*/
|
||||
private Date closingTime;
|
||||
|
||||
///
|
||||
/// 其他
|
||||
|
||||
/**
|
||||
* 是否退货
|
||||
*
|
||||
* - 0、没有
|
||||
* - 1、换货
|
||||
* - 2、退货
|
||||
* - 3、换货 + 退货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 状态(如果有多个商品分开发货需要全部商品发完才会改变状态)
|
||||
*
|
||||
* - 0、待付款
|
||||
* - 1、待发货
|
||||
* - 2、待收获
|
||||
* - 3、已完成
|
||||
* - 4、已关闭
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
///
|
||||
/// 关联信息
|
||||
|
||||
/**
|
||||
* orderItem
|
||||
*/
|
||||
private List<OrderItemBO> orderItems;
|
||||
/**
|
||||
* 订单物流信息
|
||||
*/
|
||||
private OrderRecipientBO orderRecipient;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单创建 BO
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:38
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCreateBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private Integer payAmount;
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单 info
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-14 15:36
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderInfoBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 购买(商品)总金额,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountPrice;
|
||||
/**
|
||||
* 物流金额 (分)
|
||||
*/
|
||||
private Integer logisticsPrice;
|
||||
/**
|
||||
* 最终金额,单位:分
|
||||
*
|
||||
* buyPrice + logisticsPrice - discountPrice = presentPrice
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 实际已支付金额,单位:分
|
||||
*
|
||||
* 初始时,金额为 0 。等到支付成功后,会进行更新。
|
||||
*/
|
||||
private Integer payAmount;
|
||||
|
||||
/**
|
||||
* 付款时间(待发货)
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间(待收货)
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间(已签收)
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(用户确认收货 -> status = 已完成)
|
||||
*/
|
||||
private Date closingTime;
|
||||
/**
|
||||
* 是否退货
|
||||
*
|
||||
* - 1、没有
|
||||
* - 2、换货
|
||||
* - 3、退货
|
||||
* - 4、换货 + 退货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 状态(如果有多个商品分开发货需要全部商品发完才会改变状态)
|
||||
*
|
||||
* - 1、待付款
|
||||
* - 2、待发货
|
||||
* - 3、待收获
|
||||
* - 4、已完成
|
||||
* - 5、已关闭
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 转换的字典值
|
||||
*/
|
||||
private String statusText;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
///
|
||||
/// 其他信息
|
||||
|
||||
/**
|
||||
* 手机人信息
|
||||
*/
|
||||
private Recipient recipient;
|
||||
/**
|
||||
* 最新物流信息
|
||||
*/
|
||||
private LogisticsDetail latestLogisticsDetail;
|
||||
/**
|
||||
* 订单 item
|
||||
*/
|
||||
private List<OrderItem> orderItems;
|
||||
|
||||
|
||||
///
|
||||
/// 其他字段
|
||||
|
||||
/**
|
||||
* 是否退货
|
||||
*/
|
||||
private Integer hasOrderReturn;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderItem {
|
||||
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String skuName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String skuImage;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 原始单价,单位:分。
|
||||
*/
|
||||
private Integer originPrice;
|
||||
/**
|
||||
* 购买单价,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 最终价格,单位:分。
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 购买总金额,单位:分
|
||||
*
|
||||
* 用途类似 {@link #presentTotal}
|
||||
*/
|
||||
private Integer buyTotal;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
/**
|
||||
* 最终总金额,单位:分。
|
||||
*
|
||||
* 注意,presentPrice * quantity 不一定等于 presentTotal 。
|
||||
* 因为,存在无法整除的情况。
|
||||
* 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。
|
||||
* 所以,需要存储一个该字段。
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Recipient {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 配送类型
|
||||
*
|
||||
* - 1 快递
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class LogisticsDetail {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 物流时间
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInformation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单 item
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-28 21:11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderItemBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String skuName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String skuImage;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 原始单价,单位:分。
|
||||
*/
|
||||
private Integer originPrice;
|
||||
/**
|
||||
* 购买单价,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 最终价格,单位:分。
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 购买总金额,单位:分
|
||||
*
|
||||
* 用途类似 {@link #presentTotal}
|
||||
*/
|
||||
private Integer buyTotal;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
/**
|
||||
* 最终总金额,单位:分。
|
||||
*
|
||||
* 注意,presentPrice * quantity 不一定等于 presentTotal 。
|
||||
* 因为,存在无法整除的情况。
|
||||
* 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。
|
||||
* 所以,需要存储一个该字段。
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 付款时间
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间
|
||||
*/
|
||||
private Date closingTime;
|
||||
|
||||
///
|
||||
/// 其他
|
||||
|
||||
/**
|
||||
* 是否退货
|
||||
*
|
||||
* - 1、没有
|
||||
* - 2、换货
|
||||
* - 3、退货
|
||||
* - 4、换货 + 退货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 发货方式
|
||||
*
|
||||
* - 1 未选择
|
||||
* - 2 在线下单
|
||||
* - 3 自己联系快递
|
||||
* - 4 无物流
|
||||
*/
|
||||
private Integer deliveryType;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 1、待付款
|
||||
* - 2、待发货
|
||||
* - 3、已发货
|
||||
* - 4、已完成
|
||||
* - 5、已关闭
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 删除状态
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单物流 - 最后一个物流信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 22:03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLastLogisticsInfoBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 物流 (字典)
|
||||
*/
|
||||
private Integer logistics;
|
||||
/**
|
||||
* 物流 (字典) 转换后的值
|
||||
*/
|
||||
private String logisticsText;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
|
||||
///
|
||||
/// 物流信息
|
||||
|
||||
/**
|
||||
* 最后一个物流信息
|
||||
*/
|
||||
private LogisticsDetail lastLogisticsDetail;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class LogisticsDetail {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 物流时间
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 物流时间 text
|
||||
*/
|
||||
private String logisticsTimeText;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInformation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import cn.iocoder.common.framework.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单物流信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-19 20:47
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsBO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单物流 - 详细信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 22:03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsInfoBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 物流 (字典)
|
||||
*/
|
||||
private Integer logistics;
|
||||
/**
|
||||
* 物流 (字典) 转换后的值
|
||||
*/
|
||||
private String logisticsText;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
|
||||
///
|
||||
/// 物流信息
|
||||
|
||||
private List<LogisticsDetail> details;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class LogisticsDetail {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 物流时间
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 物流时间 text
|
||||
*/
|
||||
private String logisticsTimeText;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInformation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单物流 - 详细信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 22:03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsInfoWithOrderBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private List<Logistics> logistics;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Logistics {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 物流 (字典)
|
||||
*/
|
||||
private Integer logistics;
|
||||
/**
|
||||
* 物流 (字典) 转换后的值
|
||||
*/
|
||||
private String logisticsText;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
|
||||
///
|
||||
/// 物流信息
|
||||
|
||||
private List<LogisticsDetail> details;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class LogisticsDetail {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 物流时间
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 物流时间 text
|
||||
*/
|
||||
private String logisticsTimeText;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInformation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单分页
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-27 21:27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private Integer total;
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
private List<OrderBO> orders;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单支付信息返回
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-08 19:39
|
||||
*/
|
||||
public class OrderPayBO implements Serializable {
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import cn.iocoder.common.framework.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单收件人信息 order_recipient
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-31 11:37
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderRecipientBO extends BaseDO { // TODO FROM 芋艿 TO 小范,不要继承 BaseDO
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 手机方式
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单退货 info
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-27 10:19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnInfoBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 退货信息
|
||||
*/
|
||||
private ReturnInfo returnInfo;
|
||||
/**
|
||||
* 订单 item
|
||||
*/
|
||||
private List<OrderItem> orderItems;
|
||||
/**
|
||||
* 最后一个物流信息/最新物流信息
|
||||
*/
|
||||
private OrderLastLogisticsInfoBO lastLogisticsInfo;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderItem {
|
||||
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String skuName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String skuImage;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 最终总金额,单位:分。
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class ReturnInfo {
|
||||
|
||||
/**
|
||||
* 编号自动增长
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 服务号
|
||||
*/
|
||||
private String serviceNumber;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单号 (保存一个冗余)
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
|
||||
///
|
||||
/// 退货原因
|
||||
|
||||
/**
|
||||
* 退货金额
|
||||
*/
|
||||
private Integer refundPrice;
|
||||
/**
|
||||
* 退货原因(字典值)
|
||||
*/
|
||||
private Integer reason;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 同意时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
/**
|
||||
* 物流时间(填写物流单号时间)
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(确认时间)
|
||||
*/
|
||||
private Date closingTime;
|
||||
/**
|
||||
* 退款类型
|
||||
*
|
||||
* - 1、退货退款
|
||||
* - 2、退款
|
||||
*/
|
||||
private Integer serviceType;
|
||||
/**
|
||||
* 退款类型 转换值
|
||||
*/
|
||||
private String serviceTypeText;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 1、退货申请
|
||||
* - 2、申请成功
|
||||
* - 3、申请失败
|
||||
* - 4、退货中
|
||||
* - 5、退货成功
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
import cn.iocoder.common.framework.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单退货 list
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-05-06 21:54
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnListBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 分页当前 index
|
||||
*/
|
||||
private Integer index;
|
||||
/**
|
||||
* pageSize
|
||||
*/
|
||||
private Integer pageSize;
|
||||
/**
|
||||
* totalCount
|
||||
*/
|
||||
private Integer totalCount;
|
||||
/**
|
||||
* data
|
||||
*/
|
||||
private List<OrderReturn> data;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderReturn {
|
||||
|
||||
/**
|
||||
* 编号自动增长
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 服务号
|
||||
*/
|
||||
private String serviceNumber;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单号 (保存一个冗余)
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
|
||||
///
|
||||
/// 退货原因
|
||||
|
||||
/**
|
||||
* 退货金额
|
||||
*/
|
||||
private Integer refundPrice;
|
||||
/**
|
||||
* 退货原因(字典值)
|
||||
*/
|
||||
private Integer reason;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 同意时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
/**
|
||||
* 物流时间(填写物流单号时间)
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(确认时间)
|
||||
*/
|
||||
private Date closingTime;
|
||||
/**
|
||||
* 服务类型
|
||||
*
|
||||
* - 1、退货退款
|
||||
* - 2、退款
|
||||
*/
|
||||
private Integer serviceType;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 1、退货申请
|
||||
* - 2、申请成功
|
||||
* - 3、申请失败
|
||||
* - 4、退货中
|
||||
* - 5、退货成功
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.iocoder.mall.order.biz.bo.order;
|
||||
|
||||
public class PostageDetailBO {
|
||||
|
||||
// "description": "有品甄选商品,即有品配送和第三方商家发货的商品,2018年1月1日起,单笔订单满99元免运费,不满99元收10元运费。",
|
||||
// "leftTotal": "0.00",
|
||||
// "merchantName": "有品配送",
|
||||
// "postFee": "0.00",
|
||||
// "postage": "10.00",
|
||||
// "postageType": 0,
|
||||
// "selCount": 14,
|
||||
// "threshold": "99.00"
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.mall.order.biz.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@Configuration
|
||||
@MapperScan("cn.iocoder.mall.order.biz.dao") // 扫描对应的 Mapper 接口
|
||||
@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
|
||||
public class DatabaseConfiguration {
|
||||
|
||||
// 数据库连接池 Druid
|
||||
|
||||
@Bean
|
||||
public ISqlInjector sqlInjector() {
|
||||
return new DefaultSqlInjector(); // MyBatis Plus 逻辑删除
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor(); // MyBatis Plus 分页插件
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface CartConvert {
|
||||
|
||||
CartConvert INSTANCE = Mappers.getMapper(CartConvert.class);
|
||||
|
||||
// CalcOrderPriceBO.Item convert(ProductSkuDetailBO sku);
|
||||
//
|
||||
// List<CartItemBO> convert(List<CartItemDO> items);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论 convert
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-31 18:30
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderCommentConvert {
|
||||
|
||||
OrderCommentConvert INSTANCE = Mappers.getMapper(OrderCommentConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderCommentStateInfoPageBO.OrderCommentStateInfoItem convertOrderCommentStateInfoItem(
|
||||
// OrderCommentDO orderCommentDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderCommentStateInfoPageBO.OrderCommentStateInfoItem> convertOrderCommentStateInfoItems(
|
||||
// List<OrderCommentDO> orderCommentDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderCommentDO convertOrderCommentDO(OrderCommentCreateDTO orderCommentCreateDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderCommentCreateBO convertOrderCommentCreateBO(OrderCommentDO orderCommentDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderCommentInfoBO convertOrderCommentInfoBO(OrderCommentDO orderCommentDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderCommentTimeOutBO convertOrderCommentTimeOutBO(OrderCommentDO orderCommentDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderCommentTimeOutBO> convertOrderCommentTimeOutBOList(
|
||||
// List<OrderCommentDO> orderCommentDOList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
*
|
||||
* 评论回复 convert
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-31 18:30
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderCommentReplyConvert {
|
||||
|
||||
OrderCommentReplyConvert INSTANCE = Mappers.getMapper(OrderCommentReplyConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderCommentReplyDO convert(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderCommentReplyCreateBO convert(OrderCommentReplyDO orderCommentReplyDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderCommentMerchantReplyBO> convert(List<OrderCommentReplyDO> orderCommentReplyDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderCommentReplyPageBO.OrderCommentReplayItem> convertOrderCommentReplayItem(
|
||||
// List<OrderCommentReplyDO> orderCommentReplyDOList);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单 convert
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-17 10:14
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderConvert {
|
||||
|
||||
OrderConvert INSTANCE = Mappers.getMapper(OrderConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// List<OrderBO> convertPageBO(List<OrderDO> orderDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderInfoBO convert(OrderDO orderDO);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单 item convert
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 14:34
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderItemConvert {
|
||||
|
||||
OrderItemConvert INSTANCE = Mappers.getMapper(OrderItemConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderItemDO convert(OrderItemUpdateDTO orderItemUpdateDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderItemBO> convertOrderItemBO(List<OrderItemDO> orderItemDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderItemDO> convert(List<OrderCreateDTO.OrderItem> orderCreateItemDTOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderItemBO> convertOrderItemDO(List<OrderItemDO> orderItemDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderInfoBO.OrderItem> convertOrderInfoWithOrderItem(List<OrderItemDO> orderItemDOList);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单物流 convert
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 14:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderLogisticsConvert {
|
||||
|
||||
OrderLogisticsConvert INSTANCE = Mappers.getMapper(OrderLogisticsConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderLogisticsDO convert(OrderDeliveryDTO orderDelivery);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderLogisticsDO convert(OrderLogisticsUpdateDTO orderLogisticsDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderLogisticsDO convert(OrderRecipientDO orderRecipientDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderLogisticsInfoWithOrderBO.Logistics> convertLogistics(
|
||||
// List<OrderLogisticsDO> orderLogisticsDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderLogisticsInfoWithOrderBO.LogisticsDetail> convertLogisticsDetail(
|
||||
// List<OrderLogisticsDetailDO> orderLogisticsDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderLogisticsInfoBO convert(OrderLogisticsDO orderLogisticsDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderLogisticsInfoBO.LogisticsDetail> convert(
|
||||
// List<OrderLogisticsDetailDO> orderLogisticsDetailDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// @Named(value = "orderLastLogisticsInfoBO")
|
||||
// OrderLastLogisticsInfoBO convertOrderLastLogisticsInfoBO(OrderLogisticsDO orderLogisticsDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderLastLogisticsInfoBO.LogisticsDetail convertLastLogisticsDetail(
|
||||
// OrderLogisticsDetailDO orderLogisticsDetailDO);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单物流 convert
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 14:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderLogisticsDetailConvert {
|
||||
|
||||
OrderLogisticsDetailConvert INSTANCE = Mappers.getMapper(OrderLogisticsDetailConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderInfoBO.LogisticsDetail convertLogisticsDetail(
|
||||
// OrderLogisticsDetailDO orderLogisticsDetailDO);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单收件人信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-31 12:50
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderRecipientConvert {
|
||||
|
||||
OrderRecipientConvert INSTANCE = Mappers.getMapper(OrderRecipientConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderRecipientDO convert(OrderCreateDTO orderCreateDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderRecipientDO convert(UserAddressBO userAddressBO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderRecipientBO convert(OrderRecipientDO orderRecipientDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderRecipientBO> convert(List<OrderRecipientDO> orderRecipientDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderInfoBO.Recipient convertOrderInfoRecipient(OrderRecipientDO orderRecipientDO);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.order.biz.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 订单 return
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 15:46
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderReturnConvert {
|
||||
|
||||
OrderReturnConvert INSTANCE = Mappers.getMapper(OrderReturnConvert.class);
|
||||
|
||||
// @Mappings({})
|
||||
// OrderReturnDO convert(OrderReturnCreateDTO orderReturnCreate);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderReturnDO convert(OrderReturnApplyDTO orderReturnApplyDTO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// OrderReturnInfoBO.ReturnInfo convert(OrderReturnDO orderReturnDO);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderReturnInfoBO.OrderItem> convert(List<OrderItemDO> orderItemDOList);
|
||||
//
|
||||
// @Mappings({})
|
||||
// List<OrderReturnListBO.OrderReturn> convertListBO(List<OrderReturnDO> orderReturnDOList);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.mall.order.biz.dao.cart;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.CartItemDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface CartMapper {
|
||||
//
|
||||
// CartItemDO selectById(@Param("id") Integer id);
|
||||
//
|
||||
// List<CartItemDO> selectByIds(@Param("ids") Collection<Integer> ids);
|
||||
//
|
||||
// CartItemDO selectByUserIdAndSkuIdAndStatus(@Param("userId") Integer userId,
|
||||
// @Param("skuId") Integer skuId,
|
||||
// @Param("status") Integer status);
|
||||
//
|
||||
// Integer selectQuantitySumByUserIdAndStatus(@Param("userId") Integer userId,
|
||||
// @Param("status") Integer status);
|
||||
//
|
||||
// List<CartItemDO> selectByUserIdAndStatusAndSelected(@Param("userId") Integer userId,
|
||||
// @Param("status") Integer status,
|
||||
// @Param("selected") Boolean selected);
|
||||
////
|
||||
//// List<CartItemDO> selectListByTitleLike(@Param("title") String title,
|
||||
//// @Param("offset") Integer offset,
|
||||
//// @Param("limit") Integer limit);
|
||||
//
|
||||
//// Integer selectCountByTitleLike(@Param("title") String title);
|
||||
//
|
||||
// void insert(CartItemDO cartItemDO);
|
||||
//
|
||||
// int update(CartItemDO cartItemDO);
|
||||
//
|
||||
// int updateQuantity(@Param("id") Integer id,
|
||||
// @Param("quantityIncr") Integer quantityIncr);
|
||||
//
|
||||
// int updateListByUserIdAndSkuId(@Param("userId") Integer userId,
|
||||
// @Param("skuIds") Collection<Integer> skuIds,
|
||||
// @Param("selected") Boolean selected,
|
||||
// @Param("status") Integer status);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package cn.iocoder.mall.order.biz.dao.comment;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论 mapper
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-16 20:52
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderCommentMapper{
|
||||
|
||||
|
||||
// /**
|
||||
// * 插入订单评论
|
||||
// * @param orderCommentDO
|
||||
// * @return
|
||||
// */
|
||||
// void insert(OrderCommentDO orderCommentDO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 根据 sku id 查询评论总条数
|
||||
// * @param productSkuId
|
||||
// * @return
|
||||
// */
|
||||
// int selectCommentTotalCountByProductSkuId(@Param("productSkuId") Integer productSkuId);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 分页获取评论
|
||||
// * @param orderCommentPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentDO> selectCommentPage(OrderCommentPageDTO orderCommentPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 根据评论 id 查询评论详情
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentDO selectCommentInfoByCommentId(@Param("id") Integer id);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 订单评论状态信息详情
|
||||
// * @param orderCommentStateInfoPageDTO
|
||||
// * @return
|
||||
// */
|
||||
//// List<OrderCommentDO> selectOrderCommentStateInfoPage(
|
||||
//// OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 订单评论状态总数
|
||||
// * @param userId,commentState
|
||||
// * @return
|
||||
// */
|
||||
// int selectOrderCommentStateInfoTotal(@Param("userId") Integer userId,
|
||||
// @Param("commentState") Integer commentState);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 订单评论超时分页
|
||||
// * @param orderCommentTimeOutPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentDO> selectOrderCommentTimeOutPage(
|
||||
// @Param("commentTimeOut") OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO);
|
||||
//
|
||||
// /**
|
||||
// * 批量更新订单评论状态
|
||||
// * @param orderCommentTimeOutBOList
|
||||
// * @param commentState
|
||||
// */
|
||||
// void updateBatchOrderCommentState(@Param("commentState") Integer commentState,
|
||||
// @Param("list") List<OrderCommentTimeOutBO> orderCommentTimeOutBOList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.mall.order.biz.dao.comment;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单评论回复 mapper
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-16 21:33
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderCommentReplayMapper {
|
||||
|
||||
// /**
|
||||
// * 插入订单评论回复
|
||||
// * @param orderCommentReplyDO
|
||||
// * @return
|
||||
// */
|
||||
// void insert(OrderCommentReplyDO orderCommentReplyDO);
|
||||
//
|
||||
// /**
|
||||
// * 根据评论 id 和用户类型获取商家回复
|
||||
// * @param commentId,userType
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentReplyDO> selectCommentMerchantReplyByCommentIdAndUserType(
|
||||
// @Param("commentId") Integer commentId,
|
||||
// @Param("userType") Integer userType);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 分页获取评论回复
|
||||
// * @param orderCommentReplyPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentReplyDO> selectCommentReplyPage(
|
||||
// OrderCommentReplyPageDTO orderCommentReplyPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 根据评论 id 和用户类型获取评论回复总数
|
||||
// * @param commentId,userType
|
||||
// * @return
|
||||
// */
|
||||
// int selectCommentReplyTotalCountByCommentId(@Param("commentId") Integer commentId,
|
||||
// @Param("userType") Integer userType);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 根据评论 id 查询最新的商家回复
|
||||
// * @param commentIds
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentReplyDO> selectCommentNewMerchantReplyByCommentIds(
|
||||
// @Param("commentIds") Collection<Integer> commentIds,
|
||||
// @Param("userType") Integer userType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderCancelDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单取消 mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 16:27
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderCancelMapper {
|
||||
|
||||
int insert(OrderCancelDO orderCancelDO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderItemDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单 item mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:09
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderItemMapper {
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param orderItemDOList
|
||||
*/
|
||||
void insert(@Param("list") List<OrderItemDO> orderItemDOList);
|
||||
|
||||
/**
|
||||
* 更新 - 根据Id
|
||||
*
|
||||
* @param orderItemDO
|
||||
*/
|
||||
void updateById(@Param("orderItemDO") OrderItemDO orderItemDO);
|
||||
|
||||
/**
|
||||
* 更新 - 根据 orderId
|
||||
* @param orderId
|
||||
* @param orderItemDO
|
||||
*/
|
||||
void updateByOrderId(
|
||||
@Param("orderId") Integer orderId,
|
||||
@Param("orderItemDO") OrderItemDO orderItemDO
|
||||
);
|
||||
|
||||
/**
|
||||
* 更新 - 根据Ids
|
||||
*
|
||||
* @param ids
|
||||
* @param orderItemDO
|
||||
*/
|
||||
void updateByIds(
|
||||
@Param("ids") List<Integer> ids,
|
||||
@Param("orderItemDO") OrderItemDO orderItemDO
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取 - 根据 ids 查询
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<OrderItemDO> selectByIds(@Param("ids") Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 orderIds 和 status
|
||||
*
|
||||
* @param orderIds
|
||||
* @param deleted
|
||||
* @return
|
||||
*/
|
||||
List<OrderItemDO> selectByDeletedAndOrderIds(
|
||||
@Param("orderIds") Collection<Integer> orderIds,
|
||||
@Param("deleted") Integer deleted
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 orderId 下的 item
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
List<OrderItemDO> selectByDeletedAndOrderId(
|
||||
@Param("deleted") Integer deleted,
|
||||
@Param("orderId") Integer orderId
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单物流 - 物流详细信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 21:35
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderLogisticsDetailMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param orderLogisticsDetailDO
|
||||
* @return
|
||||
*/
|
||||
int insert(OrderLogisticsDetailDO orderLogisticsDetailDO);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 物流id
|
||||
*
|
||||
* @param orderLogisticsId
|
||||
* @return
|
||||
*/
|
||||
List<OrderLogisticsDetailDO> selectByOrderLogisticsId(
|
||||
@Param("orderLogisticsId") Integer orderLogisticsId
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 物流ids
|
||||
*
|
||||
* @param orderLogisticsIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderLogisticsDetailDO> selectByOrderLogisticsIds(
|
||||
@Param("orderLogisticsIds") Collection<Integer> orderLogisticsIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 获取最新的物流信息
|
||||
*
|
||||
* @param orderLogisticsIds
|
||||
* @return
|
||||
*/
|
||||
OrderLogisticsDetailDO selectLast(
|
||||
@Param("orderLogisticsIds") Collection<Integer> orderLogisticsIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 last 根据物理id
|
||||
*
|
||||
* @param orderLogisticsId
|
||||
* @return
|
||||
*/
|
||||
OrderLogisticsDetailDO selectLastByLogisticsId(
|
||||
@Param("orderLogisticsId") Integer orderLogisticsId
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单 item mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:09
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderLogisticsMapper {
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param orderLogisticsDO
|
||||
*/
|
||||
void insert(OrderLogisticsDO orderLogisticsDO);
|
||||
|
||||
/**
|
||||
* 更新 - 根据id
|
||||
*
|
||||
* @param orderLogisticsDO
|
||||
*/
|
||||
void updateById(OrderLogisticsDO orderLogisticsDO);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 ids
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OrderLogisticsDO selectById(
|
||||
@Param("id") Integer id
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 ids
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<OrderLogisticsDO> selectByIds(
|
||||
@Param("ids") Collection<Integer> ids
|
||||
);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderDO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单 mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:09
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderMapper extends BaseMapper<OrderDO> {
|
||||
|
||||
// /**
|
||||
// * 更新 - 根据 id 更新
|
||||
// *
|
||||
// * @param orderDO
|
||||
// * @return
|
||||
// */
|
||||
// int updateById(OrderDO orderDO);
|
||||
//
|
||||
// int updateByIdAndStatus(@Param("id") Integer id,
|
||||
// @Param("status") Integer status,
|
||||
// @Param("updateObj") OrderDO updateObj);
|
||||
//
|
||||
// /**
|
||||
// * 查询 - 根据id 查询
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// OrderDO selectById(
|
||||
// @Param("id") Integer id
|
||||
// );
|
||||
//
|
||||
// /**
|
||||
// * 查询 - 后台分页page
|
||||
// *
|
||||
// * @param orderQueryDTO
|
||||
// * @return
|
||||
// */
|
||||
// int selectPageCount(OrderQueryDTO orderQueryDTO);
|
||||
//
|
||||
// /**
|
||||
// * 查询 - 后台分页page
|
||||
// *
|
||||
// * @param orderQueryDTO
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderDO> selectPage(OrderQueryDTO orderQueryDTO);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单收件人 信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-31 12:16
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderRecipientMapper {
|
||||
|
||||
/**
|
||||
* 插入 - 订单收件人
|
||||
*
|
||||
* @param orderRecipient
|
||||
* @return
|
||||
*/
|
||||
int insert(OrderRecipientDO orderRecipient);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 orderId
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
OrderRecipientDO selectByOrderId(
|
||||
@Param("orderId") Integer orderId
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 orderIds
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<OrderRecipientDO> selectByOrderIds(
|
||||
@Param("orderIds") Collection<Integer> orderIds
|
||||
);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.mall.order.biz.dao.order;
|
||||
|
||||
import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO;
|
||||
import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单退货 mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 15:36
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderReturnMapper {
|
||||
|
||||
/**
|
||||
* 插入 - 退货信息
|
||||
*
|
||||
* @param orderReturnDO
|
||||
* @return
|
||||
*/
|
||||
int insert(OrderReturnDO orderReturnDO);
|
||||
|
||||
/**
|
||||
* 更新 - 根据 orderId
|
||||
*
|
||||
* @param orderReturnDO
|
||||
* @return
|
||||
*/
|
||||
int updateById(OrderReturnDO orderReturnDO);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 orderId
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
OrderReturnDO selectByOrderId(
|
||||
@Param("orderId") Integer orderId
|
||||
);
|
||||
|
||||
/**
|
||||
* 列表查询 - queryDTO
|
||||
*
|
||||
* @param queryDTO
|
||||
* @return
|
||||
*/
|
||||
int selectListCount(OrderReturnQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 列表查询 - queryDTO
|
||||
*
|
||||
* @param queryDTO
|
||||
* @return
|
||||
*/
|
||||
List<OrderReturnDO> selectList(OrderReturnQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询 - 根据 id 查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OrderReturnDO selectById(Integer id);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 购物车的商品信息
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CartItemDO extends BaseDO {
|
||||
|
||||
// ========= 基础字段 BEGIN =========
|
||||
|
||||
/**
|
||||
* 编号,唯一自增。
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-正常
|
||||
* 2-主动删除
|
||||
* 3-下单删除
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 商品在购物车中的删除时间
|
||||
*/
|
||||
private Date deleteTime;
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private Boolean selected;
|
||||
|
||||
// ========= 基础字段 END =========
|
||||
|
||||
// ========= 买家信息 BEGIN =========
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
// ========= 买家信息 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 =========
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单关闭
|
||||
*
|
||||
* - 注意:订单只有在用户为付款前取消。
|
||||
*
|
||||
* - 取消订单,这里是取消整个订单,不能对订单 item 单独做取消
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 16:20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCancelDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 关闭订单原因(字典)
|
||||
*/
|
||||
private Integer reason;
|
||||
/**
|
||||
* 原因(如果选择其他,原因保存在这)
|
||||
*/
|
||||
private String otherReason;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单评论表
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-14 20:48
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_comment")
|
||||
public class OrderCommentDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 评论 id // TODO FROM 芋艿 TO wtz 中英文之间,要有空格
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 订单 id
|
||||
*/
|
||||
private Integer orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 商品 id
|
||||
*/
|
||||
private Integer productSpuId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productSpuName;
|
||||
|
||||
/**
|
||||
* 商品 sku id
|
||||
*/
|
||||
private Integer productSkuId;
|
||||
|
||||
/**
|
||||
* 商品 sku 属性
|
||||
*/
|
||||
private String productSkuAttrs;
|
||||
|
||||
/**
|
||||
* 商品 sku 价格
|
||||
*/
|
||||
private Integer productSkuPrice;
|
||||
|
||||
/**
|
||||
* 商品 sku url
|
||||
*/
|
||||
private String productSkuPicUrl;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 用户的真实姓名
|
||||
*/
|
||||
private String userNickName;
|
||||
|
||||
/**
|
||||
* 评价星
|
||||
*/
|
||||
private Integer star;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private Integer productDescriptionStar;
|
||||
|
||||
/**
|
||||
* 物流评价
|
||||
*/
|
||||
private Integer logisticsStar;
|
||||
|
||||
/**
|
||||
* 商家评价
|
||||
*/
|
||||
private Integer merchantStar;
|
||||
|
||||
/**
|
||||
* 回复条数
|
||||
*/
|
||||
private Integer replayCount;
|
||||
|
||||
/**
|
||||
* 点赞数 // TODO FROM 芋艿 TO wtz collect 是收藏的意思,最好换个单词噢。
|
||||
*/
|
||||
private Integer likeCount;
|
||||
|
||||
/**
|
||||
* 评论的内容
|
||||
*/
|
||||
private String commentContent;
|
||||
|
||||
/**
|
||||
* 评论的图片地址
|
||||
*/
|
||||
private String commentPics;
|
||||
|
||||
/**
|
||||
* 订单评论状态
|
||||
*/
|
||||
private Integer commentState;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 商品评价回复表
|
||||
*
|
||||
* // TODO FROM 芋艿 TO wtz 商品评价回复表 =》订单评论回复表
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-14 21:00
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "order_comment_replay")
|
||||
public class OrderCommentReplyDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 回复 id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer commentId;
|
||||
|
||||
/**
|
||||
* 回复的类型 // TODO FROM 芋艿 TO wtz 记得加下枚举类
|
||||
*/
|
||||
private Integer replyType;
|
||||
|
||||
/**
|
||||
* 父 id
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 回复目标用户 id
|
||||
*/
|
||||
private Integer parentUserId;
|
||||
|
||||
/**
|
||||
* 回复目标用户昵称
|
||||
*/
|
||||
private String parentUserNickName;
|
||||
|
||||
/**
|
||||
* 回复目标用户头像
|
||||
*/
|
||||
private String parentUserAvatar;
|
||||
|
||||
/**
|
||||
* 回复的内容
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
/**
|
||||
* 回复用户 id
|
||||
*/
|
||||
private Integer replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户昵称
|
||||
*/
|
||||
private String replyUserNickName;
|
||||
|
||||
/**
|
||||
* 回复用户头像
|
||||
*/
|
||||
private String replyUserAvatar;
|
||||
|
||||
/**
|
||||
* 回复用户身份 // TODO FROM 芋艿 TO wtz 【提示】userType 和 UserTypeEnum 记录保持一致。
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 回复点赞数
|
||||
*/
|
||||
private Integer replyLikeCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 13:49
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "orders")
|
||||
public class OrderDO extends DeletableDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 购买(商品)总金额,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountPrice;
|
||||
/**
|
||||
* 物流金额 (分)
|
||||
*/
|
||||
private Integer logisticsPrice;
|
||||
/**
|
||||
* 最终金额,单位:分
|
||||
*
|
||||
* buyPrice + logisticsPrice - discountPrice = presentPrice
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 实际已支付金额,单位:分
|
||||
*
|
||||
* 初始时,金额为 0 。等到支付成功后,会进行更新。
|
||||
*/
|
||||
private Integer payAmount;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 付款时间(待发货)
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间(待收货)
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间(已签收)
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(用户确认收货 -> status = 已完成)
|
||||
*/
|
||||
private Date closingTime;
|
||||
|
||||
///
|
||||
/// 其他
|
||||
|
||||
/**
|
||||
* 是否退货
|
||||
*
|
||||
* - 1、没有
|
||||
* - 2、换货
|
||||
* - 3、退货
|
||||
* - 4、换货 + 退货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 状态(如果有多个商品分开发货需要全部商品发完才会改变状态)
|
||||
*
|
||||
* - 1、待付款
|
||||
* - 2、待发货
|
||||
* - 3、待收获
|
||||
* - 4、已完成
|
||||
* - 5、已关闭
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 换货订单
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-19 19:48
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderExchangeDO extends DeletableDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 订单 item 编号
|
||||
*/
|
||||
private Integer orderItemId;
|
||||
/**
|
||||
* 商品id(保存一个冗余,如果一个订单下存在多个商品,会有很大的作用)
|
||||
*/
|
||||
private String skuId;
|
||||
/**
|
||||
* 换货商品id
|
||||
*/
|
||||
private String exchangeSkuId;
|
||||
/**
|
||||
* 换货物流id
|
||||
*/
|
||||
private Integer exchangeOrderLogisticsId;
|
||||
/**
|
||||
* 收件物流id
|
||||
*/
|
||||
private Integer receiverOrderLogisticsId;
|
||||
|
||||
///
|
||||
/// 原因
|
||||
|
||||
/**
|
||||
* 原因 (关联字典)
|
||||
*
|
||||
* {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum}
|
||||
*/
|
||||
private Integer orderReasonId;
|
||||
/**
|
||||
* 原因(如果选择其他,原因保存在这)
|
||||
*
|
||||
* {@link cn.iocoder.mall.order.biz.constants.OrderExchangeReasonEnum#REASON_000}
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* supper baseDO
|
||||
*/
|
||||
// private Date createTime;
|
||||
/**
|
||||
* 付款时间
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间
|
||||
*/
|
||||
private Date closingTime;
|
||||
|
||||
///
|
||||
/// 其他
|
||||
|
||||
/**
|
||||
* 订单类型
|
||||
*
|
||||
* - 0、为 Order 订单 (对整个订单退货)
|
||||
* - 1、为 OrderItem 订单 (对订单某一个商品退货)
|
||||
*/
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 申请换货
|
||||
* - 申请成功
|
||||
* - 申请失败
|
||||
* - 换货中
|
||||
* - 换货成功
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单 item
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderItemDO extends DeletableDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String skuName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String skuImage;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 原始单价,单位:分。
|
||||
*/
|
||||
private Integer originPrice;
|
||||
/**
|
||||
* 购买单价,单位:分
|
||||
*/
|
||||
private Integer buyPrice;
|
||||
/**
|
||||
* 最终价格,单位:分。
|
||||
*/
|
||||
private Integer presentPrice;
|
||||
/**
|
||||
* 购买总金额,单位:分
|
||||
*
|
||||
* 用途类似 {@link #presentTotal}
|
||||
*/
|
||||
private Integer buyTotal;
|
||||
/**
|
||||
* 优惠总金额,单位:分。
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
/**
|
||||
* 最终总金额,单位:分。
|
||||
*
|
||||
* 注意,presentPrice * quantity 不一定等于 presentTotal 。
|
||||
* 因为,存在无法整除的情况。
|
||||
* 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。
|
||||
* 所以,需要存储一个该字段。
|
||||
*/
|
||||
private Integer presentTotal;
|
||||
// 如上字段,举个例子:
|
||||
// 假设购买三个,即 quantity = 3 。
|
||||
// originPrice = 15
|
||||
// 使用限时折扣(单品优惠)8 折,buyPrice = 12
|
||||
// 开始算总的价格
|
||||
// buyTotal = buyPrice * quantity = 12 * 3 = 36
|
||||
// discountTotal ,假设有满减送(分组优惠)满 20 减 10 ,并且使用优惠劵满 1.01 减 1 ,则 discountTotal = 10 + 1 = 11
|
||||
// presentTotal = buyTotal - discountTotal = 24 - 11 = 13
|
||||
// 最终 presentPrice = presentTotal / quantity = 13 / 3 = 4.33
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 付款时间
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间
|
||||
*/
|
||||
private Date closingTime;
|
||||
|
||||
///
|
||||
/// 其他
|
||||
|
||||
/**
|
||||
* 是否退货
|
||||
*
|
||||
* - 1、没有
|
||||
* - 2、换货
|
||||
* - 3、退货
|
||||
* - 4、换货 + 退货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 发货方式
|
||||
*
|
||||
* - 1 未选择
|
||||
* - 2 在线下单
|
||||
* - 3 自己联系快递
|
||||
* - 4 无物流
|
||||
*/
|
||||
private Integer deliveryType;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 1、待付款
|
||||
* - 2、待发货
|
||||
* - 3、已发货
|
||||
* - 4、已完成
|
||||
* - 5、已关闭
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单物流信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-19 20:47
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 物流 (字典)
|
||||
*/
|
||||
private Integer logistics;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单物流 - 详细信息
|
||||
*
|
||||
* - 同步第三方物流信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-19 20:48
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsDetailDO extends DeletableDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 物流时间
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String logisticsInformation;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
/**
|
||||
* 订单优惠明细
|
||||
*/
|
||||
// TODO 芋艿 后续在完善
|
||||
public class OrderPreferentialDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 1 - 促销活动
|
||||
* 2 - 优惠劵
|
||||
*/
|
||||
private Integer type;
|
||||
// TODO 芋艿 优惠劵编号 or 促销活动编号
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 商品 SPU 编号
|
||||
*/
|
||||
private Integer spuId;
|
||||
/**
|
||||
* 商品 SKU 编号
|
||||
*/
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 传入时的价格
|
||||
*/
|
||||
private Integer originTotal;
|
||||
/**
|
||||
* 总优惠价格
|
||||
*/
|
||||
private Integer discountTotal;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单收件人信息 order_recipient (配送信息)
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-31 11:37
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderRecipientDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 配送类型
|
||||
*
|
||||
* - 1 快递
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.iocoder.mall.order.biz.dataobject;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.BaseDO;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 退货订单
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-19 19:48
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnDO extends BaseDO {
|
||||
|
||||
// TODO FROM 芋艿 TO 小范,存储下支付中心的退款单号
|
||||
|
||||
/**
|
||||
* 编号自动增长
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 服务号
|
||||
*/
|
||||
// TODO FROM 芋艿 to 小范,换个名字,看着怪怪的 哈哈哈哈。
|
||||
private String serviceNumber;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单号 (保存一个冗余)
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
|
||||
///
|
||||
/// 退货原因
|
||||
|
||||
/**
|
||||
* 退货金额
|
||||
*/
|
||||
private Integer refundPrice;
|
||||
/**
|
||||
* 退货原因(字典值)
|
||||
*
|
||||
* {@link cn.iocoder.mall.order.biz.constants.OrderReturnReasonEnum}
|
||||
*/
|
||||
private Integer reason;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
// TODO FROM 芋艿 to 小范,describe 是动词,换成名词 description
|
||||
private String describe;
|
||||
|
||||
///
|
||||
/// 时间信息
|
||||
|
||||
/**
|
||||
* 同意时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
/**
|
||||
* 拒绝时间
|
||||
*/
|
||||
private Date refuseTime;
|
||||
/**
|
||||
* 物流时间(填写物流单号时间)
|
||||
*/
|
||||
private Date logisticsTime;
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
private Date receiverTime;
|
||||
/**
|
||||
* 成交时间(确认时间)
|
||||
*/
|
||||
private Date closingTime;
|
||||
/**
|
||||
* 服务类型
|
||||
*
|
||||
* - 1、退货退款
|
||||
* - 2、退款
|
||||
*/
|
||||
private Integer serviceType;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 1、退货申请
|
||||
* - 2、申请成功
|
||||
* - 3、申请失败
|
||||
* - 4、退货中
|
||||
* - 5、已收货
|
||||
* - 6、退货成功
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
## 订单
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
**退货**
|
||||
|
||||
1. 商家未发货,退货原因
|
||||
|
||||
- 拍错/勿拍/多拍
|
||||
- 缺货
|
||||
|
||||
2. 商家已发货,退货原因
|
||||
|
||||
- 七天无理由
|
||||
- 质量问题
|
||||
- 不想要了
|
||||
- 其他
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单评论创建
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-15 20:42
|
||||
*
|
||||
*/
|
||||
@ApiModel("订单创建 DTO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentCreateDTO implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "订单 id", required = true)
|
||||
@NotNull(message = "订单 id 不能为空")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单编号", required = true)
|
||||
@NotEmpty(message = "订单编号不能为空")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "商品 spu id", required = true)
|
||||
@NotNull(message = "商品的 spu id 不能为空")
|
||||
private Integer productSpuId;
|
||||
|
||||
@ApiModelProperty(value = "商品 spu name", required = true)
|
||||
@NotEmpty(message = "商品的 spu name 不能为空")
|
||||
private String productSpuName;
|
||||
|
||||
@ApiModelProperty(value = "商品 sku id", required = true)
|
||||
@NotNull(message = "商品的 sku id 不能为空")
|
||||
private Integer productSkuId;
|
||||
|
||||
@ApiModelProperty(value = "商品 sku attrs", required = true)
|
||||
@NotEmpty(message = "商品的 sku attrs 不能为空")
|
||||
private String productSkuAttrs;
|
||||
|
||||
@ApiModelProperty(value = "商品 sku price", required = true)
|
||||
@NotNull(message = "商品的 sku price 不能为空")
|
||||
private Integer productSkuPrice;
|
||||
|
||||
@ApiModelProperty(value = "商品 sku url", required = true)
|
||||
@NotEmpty(message = "商品的 sku url 不能为空")
|
||||
private String productSkuPicUrl;
|
||||
|
||||
@ApiModelProperty(value = "用户 id", required = true)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "用户头像", required = true)
|
||||
private String userAvatar;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", required = true)
|
||||
@NotEmpty(message = "用户昵称不能为空")
|
||||
private String userNickName;
|
||||
|
||||
@ApiModelProperty(value = "评价星级", required = true,example = "1-5")
|
||||
private Integer star;
|
||||
|
||||
@ApiModelProperty(value = "商品描述星级", required = true,example = "1-5")
|
||||
private Integer productDescriptionStar;
|
||||
|
||||
@ApiModelProperty(value = "物流评价星级", required = true,example = "1-5")
|
||||
private Integer logisticsStar;
|
||||
|
||||
@ApiModelProperty(value = "商家评价星级", required = true,example = "1-5")
|
||||
private Integer merchantStar;
|
||||
|
||||
@ApiModelProperty(value = "商家评价内容", required = true,example = "1-5")
|
||||
private String commentContent;
|
||||
|
||||
@ApiModelProperty(value = "评价图片", required = true)
|
||||
private String commentPics;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论 query
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 商品 sku id
|
||||
*/
|
||||
private Integer productSkuId;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNo;
|
||||
|
||||
/**
|
||||
* 每页条数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单回复评论创建
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-16 19:07
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentReplyCreateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer commentId;
|
||||
|
||||
/**
|
||||
* 评论目标对象 id
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 评论目标用户 id
|
||||
*/
|
||||
private Integer parentUserId;
|
||||
|
||||
/**
|
||||
* 评论目标用户昵称
|
||||
*/
|
||||
private String parentUserNickName;
|
||||
|
||||
/**
|
||||
* 评论目标用户头像
|
||||
*/
|
||||
private String parentUserAvatar;
|
||||
|
||||
/**
|
||||
* 回复内容
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
/**
|
||||
* 回复用户 id
|
||||
*/
|
||||
private Integer replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户昵称
|
||||
*/
|
||||
private String replyUserNickName;
|
||||
|
||||
/**
|
||||
* 回复用户头像
|
||||
*/
|
||||
private String replyUserAvatar;
|
||||
|
||||
/**
|
||||
* 回复用户类型
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论信息详情 query
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-19 10:16
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentReplyPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
*/
|
||||
private Integer commentId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNo;
|
||||
|
||||
/**
|
||||
* 每页条数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论状态分页信息 query
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-07 10:45
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentStateInfoPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户 id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 评论状态
|
||||
*/
|
||||
private Integer commentState;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNo;
|
||||
|
||||
/**
|
||||
* 每页条数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.mall.order.biz.dto.comment;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单评论超时
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-06-15 10:59
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCommentTimeOutPageDTO implements Serializable {
|
||||
/**
|
||||
* 超过的天数
|
||||
*/
|
||||
private Integer overDay;
|
||||
|
||||
/**
|
||||
* 评论的状态
|
||||
*/
|
||||
private Integer commentState;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNo;
|
||||
|
||||
/**
|
||||
* 每页条数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计算订单价格 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单创建
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:42
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderCreateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户地址
|
||||
*/
|
||||
private Integer userAddressId;
|
||||
/**
|
||||
* 优惠劵编号
|
||||
*/
|
||||
private Integer couponCardId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* ip信息
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
///
|
||||
/// order item
|
||||
|
||||
private List<OrderItem> orderItems;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OrderItem {
|
||||
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
@Max(value = 1000)
|
||||
private Integer quantity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 22:31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderDeliveryDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
// TODO 芋艿,物流方式。会存在无需物流的情况
|
||||
/**
|
||||
* 物流公司 (字典)
|
||||
*/
|
||||
private Integer logistics;
|
||||
/**
|
||||
* 物流单编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
|
||||
///
|
||||
/// 物理信息是跟 orderItem 走
|
||||
|
||||
/**
|
||||
* 订单 orderItemId
|
||||
*/
|
||||
private List<Integer> orderItemIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Sin
|
||||
* @time 2019-03-23 10:22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderItemDeletedDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单item id
|
||||
*/
|
||||
private List<Integer> orderItemIds;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单更新
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:46
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderItemUpdateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull
|
||||
private Integer id;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
@NotNull
|
||||
private Integer price;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单收件人信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-17 20:22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderLogisticsUpdateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单 id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
@NotNull
|
||||
private String areaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
@NotNull
|
||||
private String name;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
@NotNull
|
||||
@Size(max = 11, min = 11)
|
||||
// TODO: 2019-03-17 Sin 此处需要添加 手机号校验,需要添加新的注解
|
||||
private String mobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
@NotNull
|
||||
@Size(max = 250, min = 10, message = "收件地址应该在 10 ~ 250 个字符之间")
|
||||
private String address;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单 query
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 14:15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderQueryDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 用户 id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 物流id
|
||||
*/
|
||||
private Integer orderLogisticsId;
|
||||
/**
|
||||
* 是否退换货
|
||||
*/
|
||||
private Integer hasReturnExchange;
|
||||
/**
|
||||
* 付款时间(待发货)
|
||||
*/
|
||||
private Date startPaymentTime;
|
||||
private Date endPaymentTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date startCreateTime;
|
||||
private Date endCreateTime;
|
||||
/**
|
||||
* 删除状态
|
||||
*/
|
||||
private Integer deleted;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Sin
|
||||
* @time 2019-04-25 21:06
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnApplyDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 退货原因(字典值)
|
||||
*/
|
||||
private Integer reason;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String describe;
|
||||
/**
|
||||
* 退款类型
|
||||
*
|
||||
* - 1、退货退款
|
||||
* - 2、退款
|
||||
*/
|
||||
private Integer returnType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单退货 - 创建
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 15:34
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnCreateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单 item 编号
|
||||
*/
|
||||
private Integer orderItemId;
|
||||
/**
|
||||
* 退货原因(字典值)
|
||||
*/
|
||||
private Integer orderReason;
|
||||
/**
|
||||
* 原因(如果选择其他,原因保存在这)
|
||||
*/
|
||||
private String otherReasons;
|
||||
/**
|
||||
* 订单类型
|
||||
*
|
||||
* - 0、为 Order 订单 (对整个订单退货)
|
||||
* - 1、为 OrderItem 订单 (对订单某一个商品退货)
|
||||
*/
|
||||
private Integer orderType;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单退货 查询 po
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-05-06 21:36
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderReturnQueryDTO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
/**
|
||||
* 服务号
|
||||
*/
|
||||
private String serviceNumber;
|
||||
/**
|
||||
* 创建时间 - 开始
|
||||
*/
|
||||
private Date startCreateTime;
|
||||
/**
|
||||
* 创建时间 - 结束
|
||||
*/
|
||||
private Date endCreateTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
///
|
||||
/// 分页信息
|
||||
|
||||
/**
|
||||
* 分页 index
|
||||
*/
|
||||
private Integer index;
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer pageSize;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.order.biz.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户订单 page
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-08 17:50
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderUserPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 用户 id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 付款时间(待发货)
|
||||
*/
|
||||
private Date startPaymentTime;
|
||||
private Date endPaymentTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date startCreateTime;
|
||||
private Date endCreateTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
public interface CartService {
|
||||
|
||||
// // ========== 购物车 Item 的逻辑 ==========
|
||||
//
|
||||
// /**
|
||||
// * 添加商品至购物车
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @param quantity 数量
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean add(Integer userId, Integer skuId, Integer quantity);
|
||||
//
|
||||
// /**
|
||||
// * 购物车更新商品数量
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @param quantity 数量
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean updateQuantity(Integer userId, Integer skuId, Integer quantity);
|
||||
//
|
||||
// /**
|
||||
// * 购物车更新商品是否选中
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuIds 商品 SKU 编号数组
|
||||
// * @param selected 是否选中
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean updateSelected(Integer userId, Collection<Integer> skuIds, Boolean selected);
|
||||
//
|
||||
// /**
|
||||
// * 购物车删除商品
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuIds 商品 SKU 编号的数组
|
||||
// *
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean deleteList(Integer userId, List<Integer> skuIds);
|
||||
//
|
||||
// /**
|
||||
// * 清空购物车
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean deleteAll(Integer userId);
|
||||
//
|
||||
// /**
|
||||
// * 查询用户在购物车中的商品数量
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @return 商品数量
|
||||
// */
|
||||
// Integer count(Integer userId);
|
||||
//
|
||||
// /**
|
||||
// * 显示买家购物车中的商品列表,并根据 selected 进行过滤。
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param selected 是否选中。若为空,则不进行筛选
|
||||
// * @return 购物车中商品列表信息
|
||||
// */
|
||||
// List<CartItemBO> list(Integer userId, @Nullable Boolean selected);
|
||||
//
|
||||
// // ========== 购物车与订单相关的逻辑 ==========
|
||||
//
|
||||
// /**
|
||||
// * 计算订单金额,返回计算结果
|
||||
// *
|
||||
// * @param calcOrderPriceDTO 计算订单金额 DTO
|
||||
// * @return 计算订单金额结果
|
||||
// */
|
||||
// CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO);
|
||||
//
|
||||
// /**
|
||||
// * 计算指定商品 SKU 的金额,并返回计算结果
|
||||
// *
|
||||
// * TODO 芋艿,此处只会计算,限时折扣带来的价格变化。
|
||||
// *
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @return 计算订单金额结果
|
||||
// */
|
||||
// CalcSkuPriceBO calcSkuPrice(Integer skuId); // ========== 购物车 Item 的逻辑 ==========
|
||||
//
|
||||
// /**
|
||||
// * 添加商品至购物车
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @param quantity 数量
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean add(Integer userId, Integer skuId, Integer quantity);
|
||||
//
|
||||
// /**
|
||||
// * 购物车更新商品数量
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @param quantity 数量
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean updateQuantity(Integer userId, Integer skuId, Integer quantity);
|
||||
//
|
||||
// /**
|
||||
// * 购物车更新商品是否选中
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuIds 商品 SKU 编号数组
|
||||
// * @param selected 是否选中
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean updateSelected(Integer userId, Collection<Integer> skuIds, Boolean selected);
|
||||
//
|
||||
// /**
|
||||
// * 购物车删除商品
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param skuIds 商品 SKU 编号的数组
|
||||
// *
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean deleteList(Integer userId, List<Integer> skuIds);
|
||||
//
|
||||
// /**
|
||||
// * 清空购物车
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// Boolean deleteAll(Integer userId);
|
||||
//
|
||||
// /**
|
||||
// * 查询用户在购物车中的商品数量
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @return 商品数量
|
||||
// */
|
||||
// Integer count(Integer userId);
|
||||
//
|
||||
// /**
|
||||
// * 显示买家购物车中的商品列表,并根据 selected 进行过滤。
|
||||
// *
|
||||
// * @param userId 用户编号
|
||||
// * @param selected 是否选中。若为空,则不进行筛选
|
||||
// * @return 购物车中商品列表信息
|
||||
// */
|
||||
// List<CartItemBO> list(Integer userId, @Nullable Boolean selected);
|
||||
//
|
||||
// // ========== 购物车与订单相关的逻辑 ==========
|
||||
//
|
||||
// /**
|
||||
// * 计算订单金额,返回计算结果
|
||||
// *
|
||||
// * @param calcOrderPriceDTO 计算订单金额 DTO
|
||||
// * @return 计算订单金额结果
|
||||
// */
|
||||
// CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO);
|
||||
//
|
||||
// /**
|
||||
// * 计算指定商品 SKU 的金额,并返回计算结果
|
||||
// *
|
||||
// * TODO 芋艿,此处只会计算,限时折扣带来的价格变化。
|
||||
// *
|
||||
// * @param skuId 商品 SKU 编号
|
||||
// * @return 计算订单金额结果
|
||||
// */
|
||||
// CalcSkuPriceBO calcSkuPrice(Integer skuId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论回复模块
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-29 14:30
|
||||
*
|
||||
*/
|
||||
public interface OrderCommentReplyService {
|
||||
|
||||
// /**
|
||||
// * 分页获取评论回复
|
||||
// * @param orderCommentReplyPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentReplyPageBO getOrderCommentReplyPage(
|
||||
// OrderCommentReplyPageDTO orderCommentReplyPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 评论回复创建
|
||||
// * @param orderCommentReplyCreateDTO
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentReplyCreateBO createOrderCommentReply(
|
||||
// OrderCommentReplyCreateDTO orderCommentReplyCreateDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取商家评论回复
|
||||
// * @param commentId
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentMerchantReplyBO> getOrderCommentMerchantReply(Integer commentId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
/**
|
||||
* 订单评论模块
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-14 22:10
|
||||
*/
|
||||
public interface OrderCommentService {
|
||||
|
||||
// /**
|
||||
// * 评论创建
|
||||
// * @param orderCommentCreateDTO
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO);
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取评论列表的分页
|
||||
// * @param orderCommentPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取评论详情
|
||||
// * @param commentId
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentInfoBO getOrderCommentInfo(Integer commentId);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取订单评论状态详情
|
||||
// * @param orderCommentStateInfoPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// OrderCommentStateInfoPageBO getOrderCommentStateInfoPage(
|
||||
// OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO);
|
||||
//
|
||||
// /**
|
||||
// * 获取订单评论超时分页
|
||||
// * @param orderCommentTimeOutPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// List<OrderCommentTimeOutBO> getOrderCommentTimeOutPage(
|
||||
// OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 批量更新订单评论状态
|
||||
// * @param orderCommentTimeOutBOList
|
||||
// */
|
||||
// void updateBatchOrderCommentState(List<OrderCommentTimeOutBO> orderCommentTimeOutBOList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
/**
|
||||
* 订单物流信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 21:29
|
||||
*/
|
||||
public interface OrderLogisticsService {
|
||||
|
||||
|
||||
// /**
|
||||
// * 获取物流信息 - 根据id
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderLogisticsInfoBO> getLogisticsInfo(Integer id);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取 last 物流信息 - 根据id
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderLastLogisticsInfoBO> getLastLogisticsInfo(Integer id);
|
||||
//
|
||||
// /**
|
||||
// * 获取物流信息 - 根据 orderId
|
||||
// *
|
||||
// * @param userId
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderLogisticsInfoWithOrderBO> getOrderLogisticsInfo(Integer userId,
|
||||
// Integer orderId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
/**
|
||||
* 订单退货
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 15:33
|
||||
*/
|
||||
public interface OrderReturnService {
|
||||
|
||||
|
||||
// /**
|
||||
// * 订单 - 退货
|
||||
// *
|
||||
// * @param orderReturnApplyDTO
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnApplyDTO);
|
||||
//
|
||||
// /**
|
||||
// * 更新退款成功
|
||||
// *
|
||||
// * 如果成功,则返回 success
|
||||
// * 如果失败,则返回具体原因
|
||||
// *
|
||||
// * @param orderId 订单编号
|
||||
// * @param refundPrice 退款金额
|
||||
// * @return 支付结果
|
||||
// */
|
||||
// String updateRefundSuccess(String orderId, Integer refundPrice);
|
||||
//
|
||||
// /**
|
||||
// * 订单申请信息
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderReturnInfoBO> orderApplyInfo(Integer orderId);
|
||||
//
|
||||
// /**
|
||||
// * 订单退货 - 列表
|
||||
// *
|
||||
// * @param queryDTO
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderReturnListBO> orderReturnList(OrderReturnQueryDTO queryDTO);
|
||||
//
|
||||
// /**
|
||||
// * 订单退货 - 接受
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult orderReturnAgree(Integer id);
|
||||
//
|
||||
// /**
|
||||
// * 订单退货 - 拒绝
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult orderReturnRefuse(Integer id);
|
||||
//
|
||||
// /**
|
||||
// * 订单退货 - 确认收货
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult confirmReceipt(Integer id);
|
||||
//
|
||||
// /**
|
||||
// * 订单退货 - 确认订单
|
||||
// *
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult refund(Integer id, String ip);
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package cn.iocoder.mall.order.biz.service;
|
||||
|
||||
/**
|
||||
* 订单 service
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 13:15
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
// /**
|
||||
// * 订单 page
|
||||
// *
|
||||
// * @param orderQueryDTO
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderPageBO> getOrderPage(OrderQueryDTO orderQueryDTO);
|
||||
//
|
||||
// /**
|
||||
// * 获取订单items
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<List<OrderItemBO>> getOrderItems(Integer orderId);
|
||||
//
|
||||
// /**
|
||||
// * 订单收件人信息
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderRecipientBO> getOrderRecipientBO(Integer orderId);
|
||||
//
|
||||
// /**
|
||||
// * 订单info
|
||||
// *
|
||||
// * @param userId
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderInfoBO> info(Integer userId, Integer orderId);
|
||||
//
|
||||
// /**
|
||||
// * 订单 - 创建
|
||||
// *
|
||||
// * @param orderCreateDTO
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderCreateBO> createOrder(OrderCreateDTO orderCreateDTO);
|
||||
//
|
||||
// /**
|
||||
// * 订单item - 更新
|
||||
// *
|
||||
// * @param orderItemUpdateDTO
|
||||
// *
|
||||
// */
|
||||
// CommonResult updateOrderItem(OrderItemUpdateDTO orderItemUpdateDTO);
|
||||
//
|
||||
// /**
|
||||
// * 更新订单item - payAmount(实付金额)
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @param orderItemId
|
||||
// * @param payAmount
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount);
|
||||
//
|
||||
// /**
|
||||
// * 订单 - 取消订单
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult cancelOrder(Integer orderId, Integer reasons, String otherReasons);
|
||||
//
|
||||
// /**
|
||||
// * 订单发货
|
||||
// *
|
||||
// * @param orderDelivery
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult<OrderRecipientBO> orderDelivery(OrderDeliveryDTO orderDelivery);
|
||||
//
|
||||
// /**
|
||||
// * 更新订单 - 备注
|
||||
// *
|
||||
// * @param orderId
|
||||
// * @param remake
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult updateOrderRemake(Integer orderId, String remake);
|
||||
//
|
||||
// /**
|
||||
// * 删除订单item
|
||||
// *
|
||||
// * @param orderItemDeletedDTO
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO);
|
||||
//
|
||||
// /**
|
||||
// * 用户确认订单
|
||||
// *
|
||||
// * @param userId
|
||||
// * @param orderId
|
||||
// * @return
|
||||
// */
|
||||
// CommonResult confirmReceiving(Integer userId, Integer orderId);
|
||||
//
|
||||
// /**
|
||||
// * 更新订单 - 收件这信息
|
||||
// *
|
||||
// * 包含:
|
||||
// * - 详细地址
|
||||
// * - 区域编号
|
||||
// * - 联系人电话
|
||||
// * - 联系人姓名
|
||||
// */
|
||||
// CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO);
|
||||
//
|
||||
// /**
|
||||
// * 删除订单 // TODO FROM 芋艿 to 小范。删除订单,不要使用 deleted 字段,对于用户是删除,实际是隐藏。
|
||||
// *
|
||||
// * @param id
|
||||
// */
|
||||
// CommonResult deleteOrder(Integer id);
|
||||
//
|
||||
// /**
|
||||
// * 更新订单支付成功
|
||||
// *
|
||||
// * 如果成功,则返回 success
|
||||
// * 如果失败,则返回具体原因
|
||||
// *
|
||||
// * @param orderId 订单编号
|
||||
// * @param payAmount 支付的订单金额
|
||||
// * @return 支付结果
|
||||
// */
|
||||
// String updatePaySuccess(String orderId, Integer payAmount);
|
||||
//
|
||||
// /**
|
||||
// * 监听确认收货
|
||||
// *
|
||||
// * mq 更新 status
|
||||
// */
|
||||
// CommonResult listenerConfirmGoods();
|
||||
//
|
||||
// /**
|
||||
// * 监听换货
|
||||
// *
|
||||
// * mq 更新 status
|
||||
// */
|
||||
// CommonResult listenerExchangeGoods();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.service.CartService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 购物车服务 Service 实现类
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.CartService.version}")
|
||||
public class CartServiceImpl implements CartService {
|
||||
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}")
|
||||
// private ProductSpuService productSpuService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}")
|
||||
// private PromotionActivityService promotionActivityService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.CouponService.version}")
|
||||
// private CouponService couponService;
|
||||
//
|
||||
// @Autowired
|
||||
// private CartMapper cartMapper;
|
||||
//
|
||||
// @Override
|
||||
// @SuppressWarnings("Duplicates")
|
||||
// public Boolean add(Integer userId, Integer skuId, Integer quantity) {
|
||||
// // 查询 SKU 是否合法
|
||||
// ProductSkuBO sku = productSpuService.getProductSku(skuId);
|
||||
// if (sku == null
|
||||
// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // TODO 芋艿,后续基于商品是否上下架进一步完善。
|
||||
// // 查询 CartItemDO
|
||||
// CartItemDO item = cartMapper.selectByUserIdAndSkuIdAndStatus(userId, skuId, CartItemStatusEnum.ENABLE.getValue());
|
||||
// // 存在,则进行数量更新
|
||||
// if (item != null) {
|
||||
// return updateQuantity0(item, sku, quantity);
|
||||
// }
|
||||
// // 不存在,则进行插入
|
||||
// return add0(userId, sku, quantity);
|
||||
// }
|
||||
//
|
||||
// private Boolean add0(Integer userId, ProductSkuBO sku, Integer quantity) {
|
||||
// // 校验库存
|
||||
// if (quantity > sku.getQuantity()) {
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // 创建 CartItemDO 对象,并进行保存。
|
||||
// CartItemDO item = new CartItemDO()
|
||||
// // 基础字段
|
||||
// .setStatus(CartItemStatusEnum.ENABLE.getValue()).setSelected(true)
|
||||
// // 买家信息
|
||||
// .setUserId(userId)
|
||||
// // 商品信息
|
||||
// .setSpuId(sku.getSpuId()).setSkuId(sku.getId()).setQuantity(quantity);
|
||||
// item.setCreateTime(new Date());
|
||||
// cartMapper.insert(item);
|
||||
// // 返回成功
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SuppressWarnings("Duplicates")
|
||||
// public Boolean updateQuantity(Integer userId, Integer skuId, Integer quantity) {
|
||||
// // 查询 SKU 是否合法
|
||||
// ProductSkuBO sku = productSpuService.getProductSku(skuId);
|
||||
// if (sku == null
|
||||
// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // 查询 CartItemDO
|
||||
// CartItemDO item = cartMapper.selectByUserIdAndSkuIdAndStatus(userId, skuId, CartItemStatusEnum.ENABLE.getValue());
|
||||
// if (item == null) {
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // TODO 芋艿,后续基于商品是否上下架进一步完善。
|
||||
// return updateQuantity0(item, sku, quantity);
|
||||
// }
|
||||
//
|
||||
// private Boolean updateQuantity0(CartItemDO item, ProductSkuBO sku, Integer quantity) {
|
||||
// // 校验库存
|
||||
// if (item.getQuantity() + quantity > sku.getQuantity()) {
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // 更新 CartItemDO
|
||||
// cartMapper.updateQuantity(item.getId(), quantity);
|
||||
// // 返回成功
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Boolean updateSelected(Integer userId, Collection<Integer> skuIds, Boolean selected) {
|
||||
// // 更新 CartItemDO 们
|
||||
// cartMapper.updateListByUserIdAndSkuId(userId, skuIds, selected, null);
|
||||
// // 返回成功
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Boolean deleteList(Integer userId, List<Integer> skuIds) {
|
||||
// // 更新 CartItemDO 们
|
||||
// cartMapper.updateListByUserIdAndSkuId(userId, skuIds, null, CartItemStatusEnum.DELETE_BY_MANUAL.getValue());
|
||||
// // 返回成功
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Boolean deleteAll(Integer userId) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Integer count(Integer userId) {
|
||||
// return cartMapper.selectQuantitySumByUserIdAndStatus(userId, CartItemStatusEnum.ENABLE.getValue());
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<CartItemBO> list(Integer userId, Boolean selected) {
|
||||
// List<CartItemDO> items = cartMapper.selectByUserIdAndStatusAndSelected(userId, CartItemStatusEnum.ENABLE.getValue(), selected);
|
||||
// return CartConvert.INSTANCE.convert(items);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO) {
|
||||
// // TODO 芋艿,补充一些表单校验。例如说,需要传入用户编号。
|
||||
// // 校验商品都存在
|
||||
// Map<Integer, CalcOrderPriceDTO.Item> calcOrderItemMap = calcOrderPriceDTO.getItems().stream()
|
||||
// .collect(Collectors.toMap(CalcOrderPriceDTO.Item::getSkuId, item -> item)); // KEY:skuId
|
||||
// List<ProductSkuDetailBO> skus = productSpuService.getProductSkuDetailList(calcOrderItemMap.keySet());
|
||||
// if (skus.size() != calcOrderPriceDTO.getItems().size()) {
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.ORDER_ITEM_SOME_NOT_EXISTS.getCode());
|
||||
// }
|
||||
// // TODO 库存相关
|
||||
// // 查询促销活动
|
||||
// List<PromotionActivityBO> activityList = promotionActivityService.getPromotionActivityListBySpuIds(
|
||||
// skus.stream().map(sku -> sku.getSpu().getId()).collect(Collectors.toSet()),
|
||||
// Collections.singletonList(PromotionActivityStatusEnum.RUN.getValue()));
|
||||
// // 拼装结果(主要是计算价格)
|
||||
// CalcOrderPriceBO calcOrderPriceBO = new CalcOrderPriceBO();
|
||||
// // 1. 创建初始的每一项的数组
|
||||
// List<CalcOrderPriceBO.Item> items = initCalcOrderPriceItems(skus, calcOrderItemMap);
|
||||
// // 2. 计算【限时折扣】促销
|
||||
// modifyPriceByTimeLimitDiscount(items, activityList);
|
||||
// // 3. 计算【满减送】促销
|
||||
// List<CalcOrderPriceBO.ItemGroup> itemGroups = groupByFullPrivilege(items, activityList);
|
||||
// calcOrderPriceBO.setItemGroups(itemGroups);
|
||||
// // 4. 计算优惠劵
|
||||
// if (calcOrderPriceDTO.getCouponCardId() != null) {
|
||||
// Integer result = modifyPriceByCouponCard(calcOrderPriceDTO.getUserId(), calcOrderPriceDTO.getCouponCardId(), itemGroups);
|
||||
// calcOrderPriceBO.setCouponCardDiscountTotal(result);
|
||||
// }
|
||||
// // 5. 计算最终的价格
|
||||
// int buyTotal = 0;
|
||||
// int discountTotal = 0;
|
||||
// int presentTotal = 0;
|
||||
// for (CalcOrderPriceBO.ItemGroup itemGroup : calcOrderPriceBO.getItemGroups()) {
|
||||
// buyTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getBuyTotal() : 0).sum();
|
||||
// discountTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getDiscountTotal() : 0).sum();
|
||||
// presentTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getPresentTotal() : 0).sum();
|
||||
// }
|
||||
// Assert.isTrue(buyTotal - discountTotal == presentTotal,
|
||||
// String.format("价格合计( %d - %d == %d )不正确", buyTotal, discountTotal, presentTotal));
|
||||
// calcOrderPriceBO.setFee(new CalcOrderPriceBO.Fee(buyTotal, discountTotal, 0, presentTotal));
|
||||
// // 返回
|
||||
// return calcOrderPriceBO;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SuppressWarnings("Duplicates")
|
||||
// public CalcSkuPriceBO calcSkuPrice(Integer skuId) {
|
||||
// // 查询 SKU 是否合法
|
||||
// ProductSkuBO sku = productSpuService.getProductSku(skuId);
|
||||
// if (sku == null
|
||||
// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用
|
||||
// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode());
|
||||
// }
|
||||
// // 查询促销活动
|
||||
// List<PromotionActivityBO> activityList = promotionActivityService.getPromotionActivityListBySpuId(sku.getSpuId(),
|
||||
// Arrays.asList(PromotionActivityStatusEnum.WAIT.getValue(), PromotionActivityStatusEnum.RUN.getValue()));
|
||||
// if (activityList.isEmpty()) { // 如果无促销活动,则直接返回默认结果即可
|
||||
// return new CalcSkuPriceBO().setOriginalPrice(sku.getPrice()).setBuyPrice(sku.getPrice());
|
||||
// }
|
||||
// // 如果有促销活动,则开始做计算 TODO 芋艿,因为现在暂时只有限时折扣 + 满减送。所以写的比较简单先
|
||||
// PromotionActivityBO fullPrivilege = findPromotionActivityByType(activityList, PromotionActivityTypeEnum.FULL_PRIVILEGE);
|
||||
// PromotionActivityBO timeLimitedDiscount = findPromotionActivityByType(activityList, PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT);
|
||||
// Integer presentPrice = calcSkuPriceByTimeLimitDiscount(sku, timeLimitedDiscount);
|
||||
// // 返回结果
|
||||
// return new CalcSkuPriceBO().setFullPrivilege(fullPrivilege).setTimeLimitedDiscount(timeLimitedDiscount)
|
||||
// .setOriginalPrice(sku.getPrice()).setBuyPrice(presentPrice);
|
||||
// }
|
||||
//
|
||||
// private List<CalcOrderPriceBO.Item> initCalcOrderPriceItems(List<ProductSkuDetailBO> skus,
|
||||
// Map<Integer, CalcOrderPriceDTO.Item> calcOrderItemMap) {
|
||||
// List<CalcOrderPriceBO.Item> items = new ArrayList<>();
|
||||
// for (ProductSkuDetailBO sku : skus) {
|
||||
// CalcOrderPriceBO.Item item = CartConvert.INSTANCE.convert(sku);
|
||||
// items.add(item);
|
||||
// // 将是否选中,购物数量,复制到 item 中
|
||||
// CalcOrderPriceDTO.Item calcOrderItem = calcOrderItemMap.get(sku.getId());
|
||||
// item.setSelected(calcOrderItem.getSelected());
|
||||
// item.setBuyQuantity(calcOrderItem.getQuantity());
|
||||
// // 计算初始价格
|
||||
// item.setOriginPrice(sku.getPrice());
|
||||
// item.setBuyPrice(sku.getPrice());
|
||||
// item.setPresentPrice(sku.getPrice());
|
||||
// item.setBuyTotal(sku.getPrice() * calcOrderItem.getQuantity());
|
||||
// item.setDiscountTotal(0);
|
||||
// item.setPresentTotal(item.getBuyTotal());
|
||||
// }
|
||||
// return items;
|
||||
// }
|
||||
//
|
||||
// private void modifyPriceByTimeLimitDiscount(List<CalcOrderPriceBO.Item> items, List<PromotionActivityBO> activityList) {
|
||||
// for (CalcOrderPriceBO.Item item : items) {
|
||||
// // 获得符合条件的限时折扣
|
||||
// PromotionActivityBO timeLimitedDiscount = activityList.stream()
|
||||
// .filter(activity -> PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT.getValue().equals(activity.getActivityType())
|
||||
// && activity.getTimeLimitedDiscount().getItems().stream().anyMatch(item0 -> item0.getSpuId().equals(item.getSpu().getId())))
|
||||
// .findFirst().orElse(null);
|
||||
// if (timeLimitedDiscount == null) {
|
||||
// continue;
|
||||
// }
|
||||
// // 计算价格
|
||||
// ProductSkuBO sku = new ProductSkuBO().setId(item.getId()).setSpuId(item.getSpu().getId()).setPrice(item.getPrice());
|
||||
// Integer newPrice = calcSkuPriceByTimeLimitDiscount(sku, timeLimitedDiscount);
|
||||
// if (newPrice.equals(item.getPrice())) {
|
||||
// continue;
|
||||
// }
|
||||
// // 设置优惠
|
||||
// item.setActivity(timeLimitedDiscount);
|
||||
// // 设置价格
|
||||
// item.setBuyPrice(newPrice);
|
||||
// item.setBuyTotal(newPrice * item.getBuyQuantity());
|
||||
// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal());
|
||||
// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private List<CalcOrderPriceBO.ItemGroup> groupByFullPrivilege(List<CalcOrderPriceBO.Item> items, List<PromotionActivityBO> activityList) {
|
||||
// List<CalcOrderPriceBO.ItemGroup> itemGroups = new ArrayList<>();
|
||||
// // 获得所有满减送促销
|
||||
// List<PromotionActivityBO> fullPrivileges = activityList.stream()
|
||||
// .filter(activity -> PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()))
|
||||
// .collect(Collectors.toList());
|
||||
// // 基于满减送促销,进行分组
|
||||
// if (!fullPrivileges.isEmpty()) {
|
||||
// items = new ArrayList<>(items); // 因为下面会修改数组,进行浅拷贝,避免影响传入的 items 。
|
||||
// for (PromotionActivityBO fullPrivilege : fullPrivileges) {
|
||||
// // 创建 fullPrivilege 对应的分组
|
||||
// CalcOrderPriceBO.ItemGroup itemGroup = new CalcOrderPriceBO.ItemGroup()
|
||||
// .setActivity(fullPrivilege)
|
||||
// .setItems(new ArrayList<>());
|
||||
// // 筛选商品到分组中
|
||||
// for (Iterator<CalcOrderPriceBO.Item> iterator = items.iterator(); iterator.hasNext(); ) {
|
||||
// CalcOrderPriceBO.Item item = iterator.next();
|
||||
// if (!isSpuMatchFullPrivilege(item.getSpu().getId(), fullPrivilege)) {
|
||||
// continue;
|
||||
// }
|
||||
// itemGroup.getItems().add(item);
|
||||
// iterator.remove();
|
||||
// }
|
||||
// // 如果匹配到,则添加到 itemGroups 中
|
||||
// if (!itemGroup.getItems().isEmpty()) {
|
||||
// itemGroups.add(itemGroup);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 处理未参加活动的商品,形成一个分组
|
||||
// if (!items.isEmpty()) {
|
||||
// itemGroups.add(new CalcOrderPriceBO.ItemGroup().setItems(items));
|
||||
// }
|
||||
// // 计算每个分组的价格
|
||||
// for (CalcOrderPriceBO.ItemGroup itemGroup : itemGroups) {
|
||||
// itemGroup.setActivityDiscountTotal(calcSkuPriceByFullPrivilege(itemGroup));
|
||||
// }
|
||||
// // 返回结果
|
||||
// return itemGroups;
|
||||
// }
|
||||
//
|
||||
// private Integer modifyPriceByCouponCard(Integer userId, Integer couponCardId, List<CalcOrderPriceBO.ItemGroup> itemGroups) {
|
||||
// Assert.isTrue(couponCardId != null, "优惠劵编号不能为空");
|
||||
// // 查询优惠劵
|
||||
// CouponCardDetailBO couponCard = couponService.getCouponCardDetail(userId, couponCardId);
|
||||
// // 获得匹配的商品
|
||||
// List<CalcOrderPriceBO.Item> items = new ArrayList<>();
|
||||
// if (RangeTypeEnum.ALL.getValue().equals(couponCard.getRangeType())) {
|
||||
//// totalPrice = spus.stream().mapToInt(spu -> spu.getPrice() * spu.getQuantity()).sum();
|
||||
// itemGroups.forEach(itemGroup -> items.addAll(itemGroup.getItems()));
|
||||
// } else if (RangeTypeEnum.PRODUCT_INCLUDE_PART.getValue().equals(couponCard.getRangeType())) {
|
||||
// itemGroups.forEach(itemGroup -> items.forEach(item -> {
|
||||
// if (couponCard.getRangeValues().contains(item.getSpu().getId())) {
|
||||
// items.add(item);
|
||||
// }
|
||||
// }));
|
||||
// } else if (RangeTypeEnum.PRODUCT_EXCLUDE_PART.getValue().equals(couponCard.getRangeType())) {
|
||||
// itemGroups.forEach(itemGroup -> items.forEach(item -> {
|
||||
// if (!couponCard.getRangeValues().contains(item.getSpu().getId())) {
|
||||
// items.add(item);
|
||||
// }
|
||||
// }));
|
||||
// } else if (RangeTypeEnum.CATEGORY_INCLUDE_PART.getValue().equals(couponCard.getRangeType())) {
|
||||
// itemGroups.forEach(itemGroup -> items.forEach(item -> {
|
||||
// if (couponCard.getRangeValues().contains(item.getSpu().getCid())) {
|
||||
// items.add(item);
|
||||
// }
|
||||
// }));
|
||||
// } else if (RangeTypeEnum.CATEGORY_EXCLUDE_PART.getValue().equals(couponCard.getRangeType())) {
|
||||
// itemGroups.forEach(itemGroup -> items.forEach(item -> {
|
||||
// if (!couponCard.getRangeValues().contains(item.getSpu().getCid())) {
|
||||
// items.add(item);
|
||||
// }
|
||||
// }));
|
||||
// }
|
||||
// // 判断是否符合条件
|
||||
// int originalTotal = items.stream().mapToInt(CalcOrderPriceBO.Item::getPresentTotal).sum(); // 此处,指的是以优惠劵视角的原价
|
||||
// if (originalTotal == 0 || originalTotal < couponCard.getPriceAvailable()) {
|
||||
// throw ServiceExceptionUtil.exception(PromotionErrorCodeEnum.COUPON_CARD_NOT_MATCH.getCode()); // TODO 芋艿,这种情况,会出现错误码的提示,无法格式化出来。另外,这块的最佳实践,找人讨论下。
|
||||
// }
|
||||
// // 计算价格
|
||||
// // 获得到优惠信息,进行价格计算
|
||||
// int presentTotal;
|
||||
// if (PreferentialTypeEnum.PRICE.getValue().equals(couponCard.getPreferentialType())) { // 减价
|
||||
// // 计算循环次数。这样,后续优惠的金额就是相乘了
|
||||
// presentTotal = originalTotal - couponCard.getPriceOff();
|
||||
// Assert.isTrue(presentTotal > 0, "计算后,价格为负数:" + presentTotal);
|
||||
// } else if (PreferentialTypeEnum.DISCOUNT.getValue().equals(couponCard.getPreferentialType())) { // 打折
|
||||
// presentTotal = originalTotal * couponCard.getPercentOff() / 100;
|
||||
// if (couponCard.getDiscountPriceLimit() != null // 空,代表不限制优惠上限
|
||||
// && originalTotal - presentTotal > couponCard.getDiscountPriceLimit()) {
|
||||
// presentTotal = originalTotal - couponCard.getDiscountPriceLimit();
|
||||
// }
|
||||
// } else {
|
||||
// throw new IllegalArgumentException(String.format("优惠劵(%s) 的优惠类型不正确", couponCard.toString()));
|
||||
// }
|
||||
// int discountTotal = originalTotal - presentTotal;
|
||||
// Assert.isTrue(discountTotal > 0, "计算后,不产生优惠:" + discountTotal);
|
||||
// // 按比例,拆分 presentTotal
|
||||
// splitDiscountPriceToItems(items, discountTotal, presentTotal);
|
||||
// // 返回优惠金额
|
||||
// return originalTotal - presentTotal;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 计算指定 SKU 在限时折扣下的价格
|
||||
// *
|
||||
// * @param sku SKU
|
||||
// * @param timeLimitedDiscount 限时折扣促销。
|
||||
// * 传入的该活动,要保证该 SKU 在该促销下一定有优惠。
|
||||
// * @return 计算后的价格
|
||||
// */
|
||||
// private Integer calcSkuPriceByTimeLimitDiscount(ProductSkuBO sku, PromotionActivityBO timeLimitedDiscount) {
|
||||
// if (timeLimitedDiscount == null) {
|
||||
// return sku.getPrice();
|
||||
// }
|
||||
// // 获得对应的优惠项
|
||||
// PromotionActivityBO.TimeLimitedDiscount.Item item = timeLimitedDiscount.getTimeLimitedDiscount().getItems().stream()
|
||||
// .filter(item0 -> item0.getSpuId().equals(sku.getSpuId()))
|
||||
// .findFirst().orElse(null);
|
||||
// if (item == null) {
|
||||
// throw new IllegalArgumentException(String.format("折扣活动(%s) 不存在商品(%s) 的优惠配置",
|
||||
// timeLimitedDiscount.toString(), sku.toString()));
|
||||
// }
|
||||
// // 计算价格
|
||||
// if (PreferentialTypeEnum.PRICE.getValue().equals(item.getPreferentialType())) { // 减价
|
||||
// int presentPrice = sku.getPrice() - item.getPreferentialValue();
|
||||
// return presentPrice >= 0 ? presentPrice : sku.getPrice(); // 如果计算优惠价格小于 0 ,则说明无法使用优惠。
|
||||
// }
|
||||
// if (PreferentialTypeEnum.DISCOUNT.getValue().equals(item.getPreferentialType())) { // 打折
|
||||
// return sku.getPrice() * item.getPreferentialValue() / 100;
|
||||
// }
|
||||
// throw new IllegalArgumentException(String.format("折扣活动(%s) 的优惠类型不正确", timeLimitedDiscount.toString()));
|
||||
// }
|
||||
//
|
||||
// private Integer calcSkuPriceByFullPrivilege(CalcOrderPriceBO.ItemGroup itemGroup) {
|
||||
// if (itemGroup.getActivity() == null) {
|
||||
// return null;
|
||||
// }
|
||||
// PromotionActivityBO activity = itemGroup.getActivity();
|
||||
// Assert.isTrue(PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()),
|
||||
// "传入的必须的满减送活动必须是满减送");
|
||||
// // 获得优惠信息
|
||||
// List<CalcOrderPriceBO.Item> items = itemGroup.getItems().stream().filter(CalcOrderPriceBO.Item::getSelected)
|
||||
// .collect(Collectors.toList());
|
||||
// Integer itemCnt = items.stream().mapToInt(CalcOrderPriceBO.Item::getBuyQuantity).sum();
|
||||
// Integer originalTotal = items.stream().mapToInt(CalcOrderPriceBO.Item::getPresentTotal).sum();
|
||||
// List<PromotionActivityBO.FullPrivilege.Privilege> privileges = activity.getFullPrivilege().getPrivileges().stream()
|
||||
// .filter(privilege -> {
|
||||
// if (MeetTypeEnum.PRICE.getValue().equals(privilege.getMeetType())) {
|
||||
// return originalTotal >= privilege.getMeetValue();
|
||||
// }
|
||||
// if (MeetTypeEnum.QUANTITY.getValue().equals(privilege.getMeetType())) {
|
||||
// return itemCnt >= privilege.getMeetValue();
|
||||
// }
|
||||
// throw new IllegalArgumentException(String.format("满减送活动(%s) 的匹配(%s)不正确", itemGroup.getActivity().toString(), privilege.toString()));
|
||||
// }).collect(Collectors.toList());
|
||||
// // 获得不到优惠信息,返回原始价格
|
||||
// if (privileges.isEmpty()) {
|
||||
// return null;
|
||||
// }
|
||||
// // 获得到优惠信息,进行价格计算
|
||||
// PromotionActivityBO.FullPrivilege.Privilege privilege = privileges.get(privileges.size() - 1);
|
||||
// Integer presentTotal;
|
||||
// if (PreferentialTypeEnum.PRICE.getValue().equals(privilege.getPreferentialType())) { // 减价
|
||||
// // 计算循环次数。这样,后续优惠的金额就是相乘了
|
||||
// Integer cycleCount = 1;
|
||||
// if (activity.getFullPrivilege().getCycled()) {
|
||||
// if (MeetTypeEnum.PRICE.getValue().equals(privilege.getMeetType())) {
|
||||
// cycleCount = originalTotal / privilege.getMeetValue();
|
||||
// } else if (MeetTypeEnum.QUANTITY.getValue().equals(privilege.getMeetType())) {
|
||||
// cycleCount = itemCnt / privilege.getMeetValue();
|
||||
// }
|
||||
// }
|
||||
// presentTotal = originalTotal - cycleCount * privilege.getMeetValue();
|
||||
// if (presentTotal < 0) { // 如果计算优惠价格小于 0 ,则说明无法使用优惠。
|
||||
// presentTotal = originalTotal;
|
||||
// }
|
||||
// } else if (PreferentialTypeEnum.DISCOUNT.getValue().equals(privilege.getPreferentialType())) { // 打折
|
||||
// presentTotal = originalTotal * privilege.getPreferentialValue() / 100;
|
||||
// } else {
|
||||
// throw new IllegalArgumentException(String.format("满减送促销(%s) 的优惠类型不正确", activity.toString()));
|
||||
// }
|
||||
// int discountTotal = originalTotal - presentTotal;
|
||||
// if (discountTotal == 0) {
|
||||
// return null;
|
||||
// }
|
||||
// // 按比例,拆分 presentTotal
|
||||
//// for (int i = 0; i < items.size(); i++) {
|
||||
//// CalcOrderPriceBO.Item item = items.get(i);
|
||||
//// Integer discountPart;
|
||||
//// if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减
|
||||
//// discountPart = (int) (discountTotal * (1.0D * item.getPresentTotal() / presentTotal));
|
||||
//// discountTotal -= discountPart;
|
||||
//// } else {
|
||||
//// discountPart = discountTotal;
|
||||
//// }
|
||||
//// Assert.isTrue(discountPart > 0, "优惠金额必须大于 0");
|
||||
//// item.setDiscountTotal(item.getDiscountTotal() + discountPart);
|
||||
//// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal());
|
||||
//// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity());
|
||||
//// }
|
||||
// splitDiscountPriceToItems(items, discountTotal, presentTotal);
|
||||
// // 返回优惠金额
|
||||
// return originalTotal - presentTotal;
|
||||
// }
|
||||
//
|
||||
// private void splitDiscountPriceToItems(List<CalcOrderPriceBO.Item> items, Integer discountTotal, Integer presentTotal) {
|
||||
// for (int i = 0; i < items.size(); i++) {
|
||||
// CalcOrderPriceBO.Item item = items.get(i);
|
||||
// Integer discountPart;
|
||||
// if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减
|
||||
// discountPart = (int) (discountTotal * (1.0D * item.getPresentTotal() / presentTotal));
|
||||
// discountTotal -= discountPart;
|
||||
// } else {
|
||||
// discountPart = discountTotal;
|
||||
// }
|
||||
// Assert.isTrue(discountPart > 0, "优惠金额必须大于 0");
|
||||
// item.setDiscountTotal(item.getDiscountTotal() + discountPart);
|
||||
// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal());
|
||||
// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private PromotionActivityBO findPromotionActivityByType(List<PromotionActivityBO> activityList, PromotionActivityTypeEnum type) {
|
||||
// return activityList.stream()
|
||||
// .filter(activity -> type.getValue().equals(activity.getActivityType()))
|
||||
// .findFirst().orElse(null);
|
||||
// }
|
||||
//
|
||||
// private List<PromotionActivityBO> findPromotionActivityListByType(List<PromotionActivityBO> activityList, PromotionActivityTypeEnum type) {
|
||||
// return activityList.stream()
|
||||
// .filter(activity -> type.getValue().equals(activity.getActivityType()))
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// private boolean isSpuMatchFullPrivilege(Integer spuId, PromotionActivityBO activity) {
|
||||
// Assert.isTrue(PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()),
|
||||
// "传入的必须的促销活动必须是满减送");
|
||||
// PromotionActivityBO.FullPrivilege fullPrivilege = activity.getFullPrivilege();
|
||||
// if (RangeTypeEnum.ALL.getValue().equals(fullPrivilege.getRangeType())) {
|
||||
// return true;
|
||||
// } else if (RangeTypeEnum.PRODUCT_INCLUDE_PART.getValue().equals(fullPrivilege.getRangeType())) {
|
||||
// return fullPrivilege.getRangeValues().contains(spuId);
|
||||
// } else {
|
||||
// throw new IllegalArgumentException(String.format("促销活动(%s) 可用范围的类型是不正确", activity.toString()));
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dao.comment.OrderCommentReplayMapper;
|
||||
import cn.iocoder.mall.order.biz.service.OrderCommentReplyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论回复 service impl
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-31 18:30
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true",version = "${dubbo.provider.OrderCommentReplyService.version}")
|
||||
public class OrderCommentReplyServiceImpl implements OrderCommentReplyService {
|
||||
|
||||
@Autowired
|
||||
private OrderCommentReplayMapper orderCommentReplayMapper;
|
||||
|
||||
// /**
|
||||
// * 分页获取评论回复
|
||||
// * @param orderCommentReplyPageDTO
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public OrderCommentReplyPageBO getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO) {
|
||||
// OrderCommentReplyPageBO orderCommentReplyPageBO=new OrderCommentReplyPageBO();
|
||||
// //评论回复总数
|
||||
// Integer totalCount=orderCommentReplayMapper.selectCommentReplyTotalCountByCommentId(orderCommentReplyPageDTO.getCommentId(),
|
||||
// orderCommentReplyPageDTO.getUserType());
|
||||
// //分页获取评论回复
|
||||
// List<OrderCommentReplyDO> orderCommentReplyDOList=orderCommentReplayMapper.selectCommentReplyPage(orderCommentReplyPageDTO);
|
||||
// orderCommentReplyPageBO.setTotal(totalCount);
|
||||
// orderCommentReplyPageBO.setOrderCommentReplayItems(OrderCommentReplyConvert.INSTANCE.convertOrderCommentReplayItem(orderCommentReplyDOList));
|
||||
// return orderCommentReplyPageBO;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 创建评论回复
|
||||
// * @param orderCommentReplyCreateDTO
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public OrderCommentReplyCreateBO createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO) {
|
||||
// OrderCommentReplyDO orderCommentReplyDO=OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyCreateDTO);
|
||||
// orderCommentReplyDO.setCreateTime(new Date());
|
||||
//
|
||||
// Integer replyType=orderCommentReplyCreateDTO.getCommentId()==orderCommentReplyCreateDTO.getParentId()?
|
||||
// OrderCommentRelpyTypeEnum.COMMENT_REPLY.getValue():OrderCommentRelpyTypeEnum.REPLY_REPLY.getValue();
|
||||
//
|
||||
// orderCommentReplyDO.setReplyType(replyType);
|
||||
//
|
||||
// orderCommentReplayMapper.insert(orderCommentReplyDO);
|
||||
//
|
||||
// return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取商家评论回复
|
||||
// * @param commentId
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<OrderCommentMerchantReplyBO> getOrderCommentMerchantReply(Integer commentId) {
|
||||
// List<OrderCommentReplyDO> orderCommentReplyDOList=orderCommentReplayMapper.selectCommentMerchantReplyByCommentIdAndUserType(commentId,
|
||||
// OrderReplyUserTypeEnum.MERCHANT.getValue());
|
||||
// return OrderCommentReplyConvert.INSTANCE.convert(orderCommentReplyDOList);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.dao.comment.OrderCommentMapper;
|
||||
import cn.iocoder.mall.order.biz.dao.comment.OrderCommentReplayMapper;
|
||||
import cn.iocoder.mall.order.biz.service.OrderCommentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* 订单评论 service impl
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderCommentService.version}")
|
||||
public class OrderCommentServiceImpl implements OrderCommentService {
|
||||
|
||||
@Autowired
|
||||
private OrderCommentMapper orderCommentMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderCommentReplayMapper orderCommentReplayMapper;
|
||||
|
||||
|
||||
// @Override
|
||||
// public OrderCommentCreateBO createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO) {
|
||||
// OrderCommentDO orderCommentDO=OrderCommentConvert.INSTANCE.convertOrderCommentDO(orderCommentCreateDTO);
|
||||
// orderCommentDO.setCreateTime(new Date());
|
||||
// orderCommentMapper.insert(orderCommentDO);
|
||||
// return OrderCommentConvert.INSTANCE.convertOrderCommentCreateBO(orderCommentDO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO) {
|
||||
// OrderCommentPageBO orderCommentPageBO=new OrderCommentPageBO();
|
||||
// //分页内容
|
||||
// List<OrderCommentDO> orderCommentDOList=orderCommentMapper.selectCommentPage(orderCommentPageDTO);
|
||||
// //分页评论的 id
|
||||
// List<Integer> commentIds=orderCommentDOList.stream().map(x->x.getId()).collect(Collectors.toList());
|
||||
// //获取商家最新的评论回复
|
||||
// List<OrderCommentReplyDO> orderCommentReplyDOList=orderCommentReplayMapper.selectCommentNewMerchantReplyByCommentIds(commentIds,
|
||||
// OrderReplyUserTypeEnum.MERCHANT.getValue());
|
||||
// //评论组装
|
||||
// List<OrderCommentPageBO.OrderCommentItem> orderCommentItemList=orderCommentDOList.stream()
|
||||
// .flatMap(x->orderCommentReplyDOList.stream()
|
||||
// .filter(y->x.getId()==y.getCommentId())
|
||||
// .map(y->new OrderCommentPageBO.OrderCommentItem(x.getId(),x.getUserAvatar(),x.getUserNickName(),x.getStar(),
|
||||
// x.getCommentContent(),x.getCommentPics(),x.getReplayCount(),x.getLikeCount(),x.getCreateTime(),y.getReplyContent()))
|
||||
// ).collect(Collectors.toList());
|
||||
// //总数
|
||||
// int totalCount=orderCommentMapper.selectCommentTotalCountByProductSkuId(orderCommentPageDTO.getProductSkuId());
|
||||
// orderCommentPageBO.setOrderCommentItems(orderCommentItemList);
|
||||
// orderCommentPageBO.setTotal(totalCount);
|
||||
// return orderCommentPageBO;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public OrderCommentInfoBO getOrderCommentInfo(Integer commentId) {
|
||||
// //查询评论详情
|
||||
// OrderCommentDO orderCommentDO=orderCommentMapper.selectCommentInfoByCommentId(commentId);
|
||||
// return OrderCommentConvert.INSTANCE.convertOrderCommentInfoBO(orderCommentDO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public OrderCommentStateInfoPageBO getOrderCommentStateInfoPage(OrderCommentStateInfoPageDTO orderCommentStateInfoPageDTO) {
|
||||
// OrderCommentStateInfoPageBO orderCommentStateInfoPageBO=new OrderCommentStateInfoPageBO();
|
||||
// //总数
|
||||
// int total=orderCommentMapper.selectOrderCommentStateInfoTotal(orderCommentStateInfoPageDTO.getUserId(),
|
||||
// orderCommentStateInfoPageDTO.getCommentState());
|
||||
// //查询评论状态详情
|
||||
// List<OrderCommentDO> orderCommentDOList=orderCommentMapper.selectOrderCommentStateInfoPage(orderCommentStateInfoPageDTO);
|
||||
// //转化评论状态详情
|
||||
// List<OrderCommentStateInfoPageBO.OrderCommentStateInfoItem> orderCommentStateInfoItemList=
|
||||
// OrderCommentConvert.INSTANCE.convertOrderCommentStateInfoItems(orderCommentDOList);
|
||||
// orderCommentStateInfoPageBO.setTotal(total);
|
||||
// orderCommentStateInfoPageBO.setOrderCommentStateInfoItems(orderCommentStateInfoItemList);
|
||||
// return orderCommentStateInfoPageBO;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<OrderCommentTimeOutBO> getOrderCommentTimeOutPage(OrderCommentTimeOutPageDTO orderCommentTimeOutPageDTO) {
|
||||
// List<OrderCommentDO> orderCommentDOList=orderCommentMapper.selectOrderCommentTimeOutPage(orderCommentTimeOutPageDTO);
|
||||
// return OrderCommentConvert.INSTANCE.convertOrderCommentTimeOutBOList(orderCommentDOList);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void updateBatchOrderCommentState(List<OrderCommentTimeOutBO> orderCommentTimeOutBOList) {
|
||||
// orderCommentMapper.updateBatchOrderCommentState(OrderCommentStatusEnum.SUCCESS_COMMENT.getValue(),orderCommentTimeOutBOList);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.service.OrderLogisticsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单物流
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-04-12 21:32
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderLogisticsService.version}")
|
||||
public class OrderLogisticsServiceImpl implements OrderLogisticsService {
|
||||
|
||||
// @Autowired
|
||||
// private OrderMapper orderMapper;
|
||||
// @Autowired
|
||||
// private OrderItemMapper orderItemMapper;
|
||||
// @Autowired
|
||||
// private OrderLogisticsMapper orderLogisticsMapper;
|
||||
// @Autowired
|
||||
// private OrderLogisticsDetailMapper orderLogisticsDetailMapper;
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderLogisticsInfoBO> getLogisticsInfo(Integer id) {
|
||||
// OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id);
|
||||
// if (orderLogisticsDO == null) {
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// List<OrderLogisticsDetailDO> orderLogisticsDetailDOList = orderLogisticsDetailMapper
|
||||
// .selectByOrderLogisticsId(orderLogisticsDO.getId());
|
||||
//
|
||||
// // 转换数据结构
|
||||
// List<OrderLogisticsInfoBO.LogisticsDetail> logisticsDetails
|
||||
// = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDetailDOList);
|
||||
//
|
||||
// OrderLogisticsInfoBO orderLogisticsInfo2BO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDO);
|
||||
// orderLogisticsInfo2BO.setDetails(logisticsDetails);
|
||||
// return CommonResult.success(orderLogisticsInfo2BO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderLastLogisticsInfoBO> getLastLogisticsInfo(Integer id) {
|
||||
// OrderLogisticsDO orderLogisticsDO = orderLogisticsMapper.selectById(id);
|
||||
// if (orderLogisticsDO == null) {
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// OrderLogisticsDetailDO orderLastLogisticsDetailDO = orderLogisticsDetailMapper.selectLastByLogisticsId(id);
|
||||
//
|
||||
// // 转换数据结构
|
||||
// OrderLastLogisticsInfoBO.LogisticsDetail lastLogisticsDetail
|
||||
// = OrderLogisticsConvert.INSTANCE.convertLastLogisticsDetail(orderLastLogisticsDetailDO);
|
||||
//
|
||||
// OrderLastLogisticsInfoBO lastLogisticsInfoBO = OrderLogisticsConvert
|
||||
// .INSTANCE.convertOrderLastLogisticsInfoBO(orderLogisticsDO);
|
||||
//
|
||||
// lastLogisticsInfoBO.setLastLogisticsDetail(lastLogisticsDetail);
|
||||
// return CommonResult.success(lastLogisticsInfoBO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderLogisticsInfoWithOrderBO> getOrderLogisticsInfo(Integer userId, Integer orderId) {
|
||||
// OrderDO orderDO = orderMapper.selectById(orderId);
|
||||
//
|
||||
// if (orderDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// if (!userId.equals(orderDO.getUserId())) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode());
|
||||
// }
|
||||
//
|
||||
// // 获取订单所发货的订单 id
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper.selectByDeletedAndOrderId(
|
||||
// DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//
|
||||
// // 获取物流 信息
|
||||
// Set<Integer> orderLogisticsIds = orderItemDOList.stream()
|
||||
// .filter(o -> o.getOrderLogisticsId() != null)
|
||||
// .map(o -> o.getOrderLogisticsId())
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// List<OrderLogisticsDO> orderLogisticsDOList = Collections.emptyList();
|
||||
// List<OrderLogisticsDetailDO> orderLogisticsDetailDOList = Collections.emptyList();
|
||||
// if (!CollectionUtils.isEmpty(orderLogisticsIds)) {
|
||||
// orderLogisticsDOList = orderLogisticsMapper.selectByIds(orderLogisticsIds);
|
||||
// orderLogisticsDetailDOList = orderLogisticsDetailMapper.selectByOrderLogisticsIds(orderLogisticsIds);
|
||||
// }
|
||||
//
|
||||
// // 转换 return 的数据
|
||||
// List<OrderLogisticsInfoWithOrderBO.Logistics> logistics
|
||||
// = OrderLogisticsConvert.INSTANCE.convertLogistics(orderLogisticsDOList);
|
||||
//
|
||||
// List<OrderLogisticsInfoWithOrderBO.LogisticsDetail> logisticsDetails
|
||||
// = OrderLogisticsConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDOList);
|
||||
//
|
||||
// logisticsDetails.stream().map(o -> {
|
||||
// o.setLogisticsTimeText(DateUtil.format(o.getLogisticsTime(), "yyyy-MM-dd HH:mm"));
|
||||
// return o;
|
||||
// }).collect(Collectors.toList());
|
||||
//
|
||||
// Map<Integer, List<OrderLogisticsInfoWithOrderBO.LogisticsDetail>> logisticsDetailMultimap
|
||||
// = logisticsDetails.stream().collect(
|
||||
// Collectors.toMap(
|
||||
// o -> o.getOrderLogisticsId(),
|
||||
// item -> Lists.newArrayList(item),
|
||||
// (oldVal, newVal) -> {
|
||||
// oldVal.addAll(newVal);
|
||||
// return oldVal;
|
||||
// }
|
||||
// )
|
||||
// );
|
||||
//
|
||||
// logistics.stream().map(o -> {
|
||||
// if (logisticsDetailMultimap.containsKey(o.getId())) {
|
||||
// o.setDetails(logisticsDetailMultimap.get(o.getId()));
|
||||
// }
|
||||
// return o;
|
||||
// }).collect(Collectors.toList());
|
||||
//
|
||||
// return CommonResult.success(
|
||||
// new OrderLogisticsInfoWithOrderBO()
|
||||
// .setOrderId(orderId)
|
||||
// .setOrderNo(orderDO.getOrderNo())
|
||||
// .setLogistics(logistics)
|
||||
// );
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.service.OrderReturnService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单退货 service
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-30 15:35
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderReturnService.version}")
|
||||
public class OrderReturnServiceImpl implements OrderReturnService {
|
||||
|
||||
// @Autowired
|
||||
// private OrderMapper orderMapper;
|
||||
// @Autowired
|
||||
// private OrderItemMapper orderItemMapper;
|
||||
// @Autowired
|
||||
// private OrderReturnMapper orderReturnMapper;
|
||||
// @Autowired
|
||||
// private OrderLogisticsService orderLogisticsService;
|
||||
//
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.PayRefundService.version}")
|
||||
// private PayRefundService payRefundService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.DataDictService.version}")
|
||||
// private DataDictService dataDictService;
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnDTO) {
|
||||
// OrderDO checkOrder = orderMapper.selectById(orderReturnDTO.getOrderId());
|
||||
//
|
||||
// // 检查订单是否 存在
|
||||
// if (checkOrder == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// // 转换 DO
|
||||
// OrderReturnDO orderReturnDO = OrderReturnConvert.INSTANCE.convert(orderReturnDTO);
|
||||
// orderReturnDO
|
||||
// .setOrderId(checkOrder.getId())
|
||||
// // TODO: 2019-04-27 Sin 服务号生成规则
|
||||
// .setServiceNumber(UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16))
|
||||
// .setOrderNo(checkOrder.getOrderNo())
|
||||
// .setStatus(OrderReturnStatusEnum.RETURN_APPLICATION.getValue())
|
||||
// .setCreateTime(new Date());
|
||||
//
|
||||
// // 保存申请信息
|
||||
// orderReturnMapper.insert(orderReturnDO);
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String updateRefundSuccess(String orderId, Integer refundPrice) {
|
||||
// return "success";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderReturnInfoBO> orderApplyInfo(Integer orderId) {
|
||||
//
|
||||
// // 检查订单是否退货
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId);
|
||||
// if (orderReturnDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NO_RETURN_APPLY.getCode());
|
||||
// }
|
||||
//
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//
|
||||
// // 订单不存在
|
||||
// if (CollectionUtils.isEmpty(orderItemDOList)) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// // 转换 returnInfo
|
||||
// OrderReturnInfoBO.ReturnInfo returnInfo = OrderReturnConvert.INSTANCE.convert(orderReturnDO);
|
||||
// List<OrderReturnInfoBO.OrderItem> itemList = OrderReturnConvert.INSTANCE.convert(orderItemDOList);
|
||||
//
|
||||
// // 物流信息
|
||||
// CommonResult<OrderLastLogisticsInfoBO> lastLogisticsCommonResult = orderLogisticsService
|
||||
// .getLastLogisticsInfo(orderReturnDO.getOrderLogisticsId());
|
||||
//
|
||||
// if (lastLogisticsCommonResult.isError()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_LOGISTICS_INVOKING_FAIL.getCode());
|
||||
// }
|
||||
//
|
||||
// OrderLastLogisticsInfoBO lastLogisticsInfoBO = lastLogisticsCommonResult.getData();
|
||||
// OrderReturnInfoBO orderReturnInfoBO = new OrderReturnInfoBO()
|
||||
// .setOrderItems(itemList)
|
||||
// .setReturnInfo(returnInfo)
|
||||
// .setLastLogisticsInfo(lastLogisticsInfoBO);
|
||||
//
|
||||
// return CommonResult.success(orderReturnInfoBO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderReturnListBO> orderReturnList(OrderReturnQueryDTO queryDTO) {
|
||||
// int totalCount = orderReturnMapper.selectListCount(queryDTO);
|
||||
// if (totalCount <= 0) {
|
||||
// return CommonResult.success(
|
||||
// new OrderReturnListBO()
|
||||
// .setData(Collections.EMPTY_LIST)
|
||||
// .setIndex(queryDTO.getIndex())
|
||||
// .setPageSize(queryDTO.getPageSize())
|
||||
// .setTotalCount(0)
|
||||
// );
|
||||
// }
|
||||
// List<OrderReturnDO> orderReturnDOList = orderReturnMapper.selectList(queryDTO);
|
||||
// List<OrderReturnListBO.OrderReturn> orderReturnListBOList
|
||||
// = OrderReturnConvert.INSTANCE.convertListBO(orderReturnDOList);
|
||||
//
|
||||
// return CommonResult.success(
|
||||
// new OrderReturnListBO()
|
||||
// .setData(orderReturnListBOList)
|
||||
// .setIndex(queryDTO.getIndex())
|
||||
// .setPageSize(queryDTO.getPageSize())
|
||||
// .setTotalCount(totalCount)
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult orderReturnAgree(Integer id) {
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
|
||||
// if (orderReturnDO == null) {
|
||||
// return ServiceExceptionUtil
|
||||
// .error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// orderReturnMapper.updateById(
|
||||
// new OrderReturnDO()
|
||||
// .setId(id)
|
||||
// .setApprovalTime(new Date())
|
||||
// .setStatus(OrderReturnStatusEnum.APPLICATION_SUCCESSFUL.getValue())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult orderReturnRefuse(Integer id) {
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
|
||||
// if (orderReturnDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// orderReturnMapper.updateById(
|
||||
// new OrderReturnDO()
|
||||
// .setId(id)
|
||||
// .setRefuseTime(new Date())
|
||||
// .setStatus(OrderReturnStatusEnum.APPLICATION_FAIL.getValue())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult confirmReceipt(Integer id) {
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
|
||||
// if (orderReturnDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// orderReturnMapper.updateById(
|
||||
// new OrderReturnDO()
|
||||
// .setId(id)
|
||||
// .setReceiverTime(new Date())
|
||||
// .setStatus(OrderReturnStatusEnum.ORDER_RECEIPT.getValue())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public CommonResult refund(Integer id, String ip) {
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
|
||||
// if (orderReturnDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// // TODO: 2019/5/8 sin, 发送 MQ 消息,申请退货成功!
|
||||
// // TODO: 2019/5/8 sin 退款:支付系统退款
|
||||
// // TODO: 2019/5/8 sin 退货+退款:退回商品签收后,支付系统退款
|
||||
// // TODO: 2019/5/8 sin 事务一致性 [重要]
|
||||
//
|
||||
//
|
||||
// CommonResult<DataDictBO> dataDictResult = dataDictService
|
||||
// .getDataDict(DictKeyConstants.ORDER_RETURN_REASON, orderReturnDO.getReason());
|
||||
//
|
||||
// if (dataDictResult.isError()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.DICT_SERVER_INVOKING_FAIL.getCode());
|
||||
// }
|
||||
//
|
||||
// // 支付退款
|
||||
// String orderDescription = dataDictResult.getData()
|
||||
// .getDisplayName() + "(" + orderReturnDO.getDescribe() + ")";
|
||||
//
|
||||
// CommonResult payResult = payRefundService.submitRefund(
|
||||
// new PayRefundSubmitDTO()
|
||||
// .setAppId(PayAppId.APP_ID_SHOP_ORDER)
|
||||
// .setOrderId(String.valueOf(orderReturnDO.getOrderId()))
|
||||
// .setPrice(orderReturnDO.getRefundPrice())
|
||||
// .setOrderDescription(orderDescription)
|
||||
// .setCreateIp(ip)
|
||||
// );
|
||||
//
|
||||
// if (!payResult.isSuccess()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_REFUND_FAILED.getCode());
|
||||
// }
|
||||
//
|
||||
// // 更新 订单退货 信息
|
||||
// orderReturnMapper.updateById(
|
||||
// new OrderReturnDO()
|
||||
// .setId(id)
|
||||
// .setClosingTime(new Date())
|
||||
// .setStatus(OrderReturnStatusEnum.RETURN_SUCCESS.getValue())
|
||||
// );
|
||||
//
|
||||
// // 更新订单
|
||||
// orderMapper.updateById(
|
||||
// new OrderDO()
|
||||
// .setId(orderReturnDO.getOrderId())
|
||||
// .setClosingTime(new Date())
|
||||
// .setStatus(OrderStatusEnum.COMPLETED.getValue())
|
||||
// );
|
||||
//
|
||||
// // 更新订单
|
||||
// orderItemMapper.updateByOrderId(
|
||||
// orderReturnDO.getOrderId(),
|
||||
// new OrderItemDO()
|
||||
// .setClosingTime(new Date())
|
||||
// .setStatus(OrderStatusEnum.COMPLETED.getValue())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,604 @@
|
||||
package cn.iocoder.mall.order.biz.service.impl;
|
||||
|
||||
import cn.iocoder.mall.order.biz.service.OrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单 service impl
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:08
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderService.version}")
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
|
||||
// /**
|
||||
// * 支付过期时间 120 分钟
|
||||
// */
|
||||
// public static final int PAY_EXPIRE_TIME = 120;
|
||||
//
|
||||
// @Autowired
|
||||
// private OrderMapper orderMapper;
|
||||
// @Autowired
|
||||
// private OrderItemMapper orderItemMapper;
|
||||
// @Autowired
|
||||
// private OrderLogisticsMapper orderLogisticsMapper;
|
||||
// @Autowired
|
||||
// private OrderLogisticsDetailMapper orderLogisticsDetailMapper;
|
||||
// @Autowired
|
||||
// private OrderRecipientMapper orderRecipientMapper;
|
||||
// @Autowired
|
||||
// private OrderCancelMapper orderCancelMapper;
|
||||
// @Autowired
|
||||
// private OrderReturnMapper orderReturnMapper;
|
||||
//
|
||||
// @Autowired
|
||||
// private CartServiceImpl cartService;
|
||||
//
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}")
|
||||
// private ProductSpuService productSpuService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.UserAddressService.version}")
|
||||
// private UserAddressService userAddressService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.PayTransactionService.version}")
|
||||
// private PayTransactionService payTransactionService;
|
||||
// @Reference(validation = "true", version = "${dubbo.consumer.CouponService.version}")
|
||||
// private CouponService couponService;
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderPageBO> getOrderPage(OrderQueryDTO orderQueryDTO) {
|
||||
//
|
||||
// int totalCount = orderMapper.selectPageCount(orderQueryDTO);
|
||||
// if (totalCount == 0) { // TODO FROM 芋艿 TO 小范 Collections.EMPTY_LIST 改成 Collections.emptyList()
|
||||
// return CommonResult.success(new OrderPageBO().setOrders(Collections.EMPTY_LIST).setTotal(0));
|
||||
// }
|
||||
//
|
||||
// // 获取订单数据
|
||||
// List<OrderDO> orderDOList = orderMapper.selectPage(orderQueryDTO);
|
||||
//
|
||||
// if (CollectionUtils.isEmpty(orderDOList)) {
|
||||
// return CommonResult.success(new OrderPageBO().setOrders(Collections.EMPTY_LIST).setTotal(totalCount));
|
||||
// }
|
||||
//
|
||||
// // 获取订单 id
|
||||
// Set<Integer> orderIds = orderDOList.stream()
|
||||
// .map(orderDO -> orderDO.getId()) // TODO FROM 芋艿 to 小范,记得用 Lambda
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// // 获取配送信息
|
||||
// List<OrderRecipientDO> orderRecipientDOList = orderRecipientMapper.selectByOrderIds(orderIds);
|
||||
// List<OrderRecipientBO> orderRecipientBOList = OrderRecipientConvert.INSTANCE.convert(orderRecipientDOList);
|
||||
// Map<Integer, OrderRecipientBO> orderRecipientBOMap
|
||||
// = orderRecipientBOList.stream().collect(Collectors.toMap(OrderRecipientBO::getOrderId, obj -> obj));
|
||||
//
|
||||
// // 获取 订单的 items
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderIds(orderIds, DeletedStatusEnum.DELETED_NO.getValue());
|
||||
//
|
||||
// List<OrderItemBO> orderItemBOList = OrderItemConvert.INSTANCE.convertOrderItemDO(orderItemDOList);
|
||||
// Map<Integer, List<OrderItemBO>> orderItemBOMultimap = orderItemBOList.stream().collect(
|
||||
// Collectors.toMap(
|
||||
// OrderItemBO::getOrderId,
|
||||
// item -> Lists.newArrayList(item),
|
||||
// (oldVal, newVal) -> {
|
||||
// oldVal.addAll(newVal);
|
||||
// return oldVal;
|
||||
// }
|
||||
// )
|
||||
// );
|
||||
//
|
||||
// // 转换 orderDO 为 OrderBO,并设置 item
|
||||
// List<OrderBO> orderPageBOList = OrderConvert.INSTANCE.convertPageBO(orderDOList);
|
||||
// List<OrderBO> result = orderPageBOList.stream().map(orderBO -> {
|
||||
// if (orderItemBOMultimap.containsKey(orderBO.getId())) {
|
||||
// orderBO.setOrderItems(orderItemBOMultimap.get(orderBO.getId()));
|
||||
// }
|
||||
// if (orderRecipientBOMap.containsKey(orderBO.getId())) {
|
||||
// orderBO.setOrderRecipient(orderRecipientBOMap.get(orderBO.getId()));
|
||||
// }
|
||||
// return orderBO;
|
||||
// }).collect(Collectors.toList());
|
||||
// return CommonResult.success(
|
||||
// new OrderPageBO()
|
||||
// .setTotal(totalCount)
|
||||
// .setOrders(result)
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<List<OrderItemBO>> getOrderItems(Integer orderId) {
|
||||
// if (orderMapper.selectById(orderId) == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//
|
||||
// List<OrderItemBO> orderItemBOList = OrderItemConvert.INSTANCE.convertOrderItemBO(orderItemDOList);
|
||||
// return CommonResult.success(orderItemBOList);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderRecipientBO> getOrderRecipientBO(Integer orderId) {
|
||||
// if (orderMapper.selectById(orderId) == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId);
|
||||
// OrderRecipientBO orderRecipientBO = OrderRecipientConvert.INSTANCE.convert(orderRecipientDO);
|
||||
// return CommonResult.success(orderRecipientBO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult<OrderInfoBO> info(Integer userId, Integer orderId) {
|
||||
// OrderDO orderDO = orderMapper.selectById(orderId);
|
||||
// if (orderDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// List<OrderItemDO> itemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//
|
||||
// List<OrderInfoBO.OrderItem> orderItems
|
||||
// = OrderItemConvert.INSTANCE.convertOrderInfoWithOrderItem(itemDOList);
|
||||
//
|
||||
// Set<Integer> orderLogisticsIds = itemDOList.stream()
|
||||
// .filter(o -> o.getOrderLogisticsId() != null)
|
||||
// .map(o -> o.getOrderLogisticsId())
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
//
|
||||
//
|
||||
// // 收件人信息
|
||||
// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId);
|
||||
//
|
||||
// // 订单物流信息
|
||||
// OrderLogisticsDetailDO orderLogisticsDetailDO = null;
|
||||
// if (!CollectionUtils.isEmpty(orderLogisticsIds)) {
|
||||
// orderLogisticsDetailDO = orderLogisticsDetailMapper.selectLast(orderLogisticsIds);
|
||||
// }
|
||||
//
|
||||
// // 检查是否申请退货
|
||||
// OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId);
|
||||
//
|
||||
// // convert 信息
|
||||
// OrderInfoBO.LogisticsDetail logisticsDetail
|
||||
// = OrderLogisticsDetailConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDO);
|
||||
//
|
||||
// OrderInfoBO.Recipient recipient = OrderRecipientConvert.INSTANCE.convertOrderInfoRecipient(orderRecipientDO);
|
||||
// OrderInfoBO orderInfoBO = OrderConvert.INSTANCE.convert(orderDO);
|
||||
// orderInfoBO.setRecipient(recipient);
|
||||
// orderInfoBO.setOrderItems(orderItems);
|
||||
// orderInfoBO.setLatestLogisticsDetail(logisticsDetail);
|
||||
//
|
||||
// // 是否退货
|
||||
// if (orderReturnDO != null) {
|
||||
// orderInfoBO.setHasOrderReturn(orderReturnDO.getStatus());
|
||||
// } else {
|
||||
// orderInfoBO.setHasOrderReturn(-1);
|
||||
// }
|
||||
// return CommonResult.success(orderInfoBO);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @GlobalTransactional
|
||||
//// @Transactional // 使用 Seata 分布事务后,无需在使用 @Transactional 注解。
|
||||
// public CommonResult<OrderCreateBO> createOrder(OrderCreateDTO orderCreateDTO) {
|
||||
// Integer userId = orderCreateDTO.getUserId();
|
||||
// List<OrderCreateDTO.OrderItem> orderItemDTOList = orderCreateDTO.getOrderItems();
|
||||
// List<OrderItemDO> orderItemDOList = OrderItemConvert.INSTANCE.convert(orderItemDTOList);
|
||||
//
|
||||
// // 获取商品信息
|
||||
// Set<Integer> skuIds = orderItemDOList.stream().map(OrderItemDO::getSkuId).collect(Collectors.toSet());
|
||||
// List<ProductSkuDetailBO> productList = productSpuService.getProductSkuDetailList(skuIds);
|
||||
// if (orderItemDTOList.size() != productList.size()) { // 校验获得的数量,是否匹配
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_GOODS_INFO_INCORRECT.getCode());
|
||||
// }
|
||||
//
|
||||
// // 价格计算
|
||||
// CalcOrderPriceBO calcOrderPrice = calcOrderPrice(productList, orderCreateDTO);
|
||||
//
|
||||
// // 设置 orderItem
|
||||
// Map<Integer, ProductSkuDetailBO> productSpuBOMap = productList
|
||||
// .stream().collect(Collectors.toMap(ProductSkuDetailBO::getId, o -> o)); // 商品 SKU 信息的集合
|
||||
// Map<Integer, CalcOrderPriceBO.Item> priceItemMap = new HashMap<>(); // 商品 SKU 价格的映射
|
||||
// calcOrderPrice.getItemGroups().forEach(itemGroup ->
|
||||
// itemGroup.getItems().forEach(item -> priceItemMap.put(item.getId(), item)));
|
||||
// // 遍历 orderItemDOList 数组,将商品信息、商品价格,设置到其中
|
||||
// for (OrderItemDO orderItemDO : orderItemDOList) {
|
||||
// ProductSkuDetailBO productSkuDetailBO = productSpuBOMap.get(orderItemDO.getSkuId());
|
||||
// if (productSkuDetailBO.getQuantity() <= 0) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_INSUFFICIENT_INVENTORY.getCode());
|
||||
// }
|
||||
// if (productSkuDetailBO.getPrice() <= 0) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GOODS_AMOUNT_INCORRECT.getCode());
|
||||
// }
|
||||
// // 设置 SKU 信息
|
||||
// orderItemDO.setSkuImage(Optional.ofNullable(productSkuDetailBO.getSpu().getPicUrls().get(0)).get());
|
||||
// orderItemDO.setSkuName(productSkuDetailBO.getSpu().getName());
|
||||
// // 设置价格信息
|
||||
// CalcOrderPriceBO.Item priceItem = priceItemMap.get(orderItemDO.getSkuId());
|
||||
// Assert.notNull(priceItem, "商品计算价格为空");
|
||||
// orderItemDO.setOriginPrice(priceItem.getOriginPrice())
|
||||
// .setBuyPrice(priceItem.getBuyPrice())
|
||||
// .setPresentPrice(priceItem.getPresentPrice())
|
||||
// .setBuyTotal(priceItem.getBuyTotal())
|
||||
// .setDiscountTotal(priceItem.getDiscountTotal())
|
||||
// .setPresentTotal(priceItem.getPresentTotal());
|
||||
// }
|
||||
//
|
||||
// // 标记优惠劵已使用
|
||||
// if (orderCreateDTO.getCouponCardId() != null) {
|
||||
// couponService.useCouponCard(userId, orderCreateDTO.getCouponCardId());
|
||||
// }
|
||||
//
|
||||
// // TODO 芋艿,扣除库存
|
||||
//
|
||||
// // order
|
||||
//
|
||||
// // TODO: 2019-04-11 Sin 订单号需要生成规则
|
||||
// // TODO FROM 芋艿 to 小范:可以考虑抽象成一个方法,下面几个也是。
|
||||
// String orderNo = UUID.randomUUID().toString().replace("-", "").substring(0, 16);
|
||||
//// Integer totalAmount = orderCommon.calculatedAmount(orderItemDOList);
|
||||
//// Integer totalPrice = orderCommon.calculatedPrice(orderItemDOList);
|
||||
//// Integer totalLogisticsPrice = orderCommon.calculatedLogisticsPrice(orderItemDOList);
|
||||
// OrderDO orderDO = new OrderDO()
|
||||
// .setUserId(userId)
|
||||
// .setOrderNo(orderNo)
|
||||
// .setBuyPrice(calcOrderPrice.getFee().getBuyTotal())
|
||||
// .setDiscountPrice(calcOrderPrice.getFee().getDiscountTotal())
|
||||
// .setLogisticsPrice(calcOrderPrice.getFee().getPostageTotal())
|
||||
// .setPresentPrice(calcOrderPrice.getFee().getPresentTotal())
|
||||
// .setPayAmount(0)
|
||||
// .setClosingTime(null)
|
||||
// .setDeliveryTime(null)
|
||||
// .setPaymentTime(null)
|
||||
// .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue())
|
||||
// .setHasReturnExchange(OrderHasReturnExchangeEnum.NO.getValue())
|
||||
// .setRemark(Optional.ofNullable(orderCreateDTO.getRemark()).orElse(""));
|
||||
// orderDO.setDeleted(DeletedStatusEnum.DELETED_NO.getValue());
|
||||
//// orderDO.setCreateTime(new Date());
|
||||
//// orderDO.setUpdateTime(null);
|
||||
// orderMapper.insert(orderDO);
|
||||
//
|
||||
// // 收件人信息
|
||||
// CommonResult<UserAddressBO> userAddressResult = userAddressService.getAddress(userId, orderCreateDTO.getUserAddressId());
|
||||
// if (userAddressResult.isError()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_USER_ADDRESS_FAIL.getCode());
|
||||
// }
|
||||
// UserAddressBO userAddressBO = userAddressResult.getData();
|
||||
// OrderRecipientDO orderRecipientDO = OrderRecipientConvert.INSTANCE.convert(userAddressBO);
|
||||
// orderRecipientDO
|
||||
// .setOrderId(orderDO.getId())
|
||||
// .setType(OrderRecipientTypeEnum.EXPRESS.getValue())
|
||||
// .setCreateTime(new Date())
|
||||
// .setUpdateTime(null);
|
||||
// orderRecipientMapper.insert(orderRecipientDO);
|
||||
//
|
||||
// // order item
|
||||
// orderItemDOList.forEach(orderItemDO -> {
|
||||
// orderItemDO
|
||||
// .setOrderId(orderDO.getId())
|
||||
// .setOrderNo(orderDO.getOrderNo())
|
||||
// .setPaymentTime(null)
|
||||
// .setDeliveryTime(null)
|
||||
// .setReceiverTime(null)
|
||||
// .setClosingTime(null)
|
||||
// .setHasReturnExchange(OrderStatusEnum.WAITING_PAYMENT.getValue())
|
||||
// .setDeliveryType(OrderDeliveryTypeEnum.NONE.getValue())
|
||||
// .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue())
|
||||
// .setDeleted(DeletedStatusEnum.DELETED_NO.getValue())
|
||||
// .setCreateTime(new Date())
|
||||
// .setUpdateTime(null);
|
||||
// });
|
||||
// // 一次性插入
|
||||
// orderItemMapper.insert(orderItemDOList);
|
||||
//
|
||||
// // 创建预订单
|
||||
// createPayTransaction(orderDO, orderItemDOList, orderCreateDTO.getIp());
|
||||
//
|
||||
//// if (commonResult.isError()) {
|
||||
//// //手动开启事务回滚
|
||||
//// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
//// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_PAY_FAIL.getValue());
|
||||
//// }
|
||||
//
|
||||
// // TODO: 2019-03-17 Sin 需要发送 创建成果 MQ 消息,业务扩展和统计
|
||||
// return CommonResult.success(
|
||||
// new OrderCreateBO()
|
||||
// .setId(orderDO.getId())
|
||||
// .setOrderNo(orderDO.getOrderNo())
|
||||
// .setPayAmount(orderDO.getPayAmount())
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// private CalcOrderPriceBO calcOrderPrice(List<ProductSkuDetailBO> skus, OrderCreateDTO orderCreateDTO) {
|
||||
// // 创建计算的 DTO
|
||||
// CalcOrderPriceDTO calcOrderPriceDTO = new CalcOrderPriceDTO()
|
||||
// .setUserId(orderCreateDTO.getUserId())
|
||||
// .setItems(new ArrayList<>(skus.size()))
|
||||
// .setCouponCardId(orderCreateDTO.getCouponCardId());
|
||||
// for (OrderCreateDTO.OrderItem item : orderCreateDTO.getOrderItems()) {
|
||||
// calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getSkuId(), item.getQuantity(), true));
|
||||
// }
|
||||
// // 执行计算
|
||||
// return cartService.calcOrderPrice(calcOrderPriceDTO);
|
||||
// }
|
||||
//
|
||||
// private PayTransactionBO createPayTransaction(OrderDO order, List<OrderItemDO> orderItems, String ip) {
|
||||
// // TODO sin 支付订单 orderSubject 暂时取第一个子订单商品信息
|
||||
// String orderSubject = orderItems.get(0).getSkuName();
|
||||
// Date expireTime = DateUtil.addDate(Calendar.MINUTE, PAY_EXPIRE_TIME);
|
||||
// return payTransactionService.createTransaction(
|
||||
// new PayTransactionCreateDTO()
|
||||
// .setCreateIp(ip)
|
||||
// .setAppId(PayAppId.APP_ID_SHOP_ORDER)
|
||||
// .setOrderId(order.getId().toString())
|
||||
// .setExpireTime(expireTime)
|
||||
// .setPrice(order.getPresentPrice())
|
||||
// .setOrderSubject(orderSubject)
|
||||
// .setOrderMemo("测试备注") // TODO 芋艿,后面补充
|
||||
// .setOrderDescription("测试描述") // TODO 芋艿,后面补充
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// @Override // TODO 芋艿,需要确认下这个方法的用途。因为涉及修改价格和数量。
|
||||
// public CommonResult updateOrderItem(OrderItemUpdateDTO orderUpdateDTO) {
|
||||
// OrderItemDO orderItemDO = OrderItemConvert.INSTANCE.convert(orderUpdateDTO);
|
||||
// orderItemMapper.updateById(orderItemDO);
|
||||
//
|
||||
// // TODO: 2019-03-24 sin 需要重新计算金额
|
||||
// // TODO: 2019-03-24 sin 需要记录日志
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount) {
|
||||
// OrderDO orderDO = orderMapper.selectById(orderId);
|
||||
// if (orderDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
// if (payAmount < 0) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_PAY_AMOUNT_NOT_NEGATIVE.getCode());
|
||||
// }
|
||||
//
|
||||
// // 先更新金额
|
||||
// orderItemMapper.updateById(new OrderItemDO().setId(orderItemId)
|
||||
//// .setPayAmount(payAmount) TODO 芋艿,这里要修改
|
||||
// );
|
||||
//
|
||||
// // 再重新计算订单金额
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//// Integer price = orderCommon.calculatedPrice(orderItemDOList);
|
||||
//// Integer amount = orderCommon.calculatedAmount(orderItemDOList);
|
||||
// Integer price = -1; // TODO 芋艿,这里要修改,价格
|
||||
// Integer amount = -1;
|
||||
// orderMapper.updateById(
|
||||
// new OrderDO()
|
||||
// .setId(orderId)
|
||||
//// .setPrice(price) TODO 芋艿,这里要修改
|
||||
// .setPayAmount(amount)
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional // TODO 芋艿,要校验下 userId 。不然可以取消任何用户的订单列。
|
||||
// public CommonResult cancelOrder(Integer orderId, Integer reason, String otherReason) {
|
||||
// // 关闭订单,在用户还未付款的时候可操作
|
||||
// OrderDO orderDO = orderMapper.selectById(orderId);
|
||||
// if (orderDO == null) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
|
||||
// }
|
||||
//
|
||||
// // 检查专题,只有待付款状态才能操作
|
||||
// if (!orderDO.getStatus().equals(OrderStatusEnum.WAITING_PAYMENT.getValue())) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_CANCEL.getCode());
|
||||
// }
|
||||
//
|
||||
// OrderCancelDO orderCancelDO
|
||||
// = (OrderCancelDO) new OrderCancelDO()
|
||||
// .setOrderId(orderDO.getId())
|
||||
// .setOrderNo(orderDO.getOrderNo())
|
||||
// .setReason(reason)
|
||||
// .setOtherReason(otherReason)
|
||||
// .setCreateTime(new Date())
|
||||
// .setUpdateTime(null);
|
||||
//
|
||||
// // 关闭订单,修改状态 item
|
||||
// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题
|
||||
// orderItemMapper.updateByOrderId(
|
||||
// orderId,
|
||||
// new OrderItemDO().setStatus(OrderStatusEnum.CLOSED.getValue())
|
||||
// );
|
||||
//
|
||||
// // 关闭订单,修改状态 order
|
||||
// orderMapper.updateById(new OrderDO().setId(orderId).setStatus(OrderStatusEnum.CLOSED.getValue()));
|
||||
// // 保存取消订单原因
|
||||
// orderCancelMapper.insert(orderCancelDO);
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional // TODO FROM 芋艿 TO 小范:泛型,一定要明确哈。
|
||||
// public CommonResult orderDelivery(OrderDeliveryDTO orderDelivery) {
|
||||
// List<Integer> orderItemIds = orderDelivery.getOrderItemIds();
|
||||
//
|
||||
// // 获取所有订单 items // TODO FROM 芋艿 TO 小范,deleted 是默认条件,所以 by 里面可以不带哈
|
||||
// List<OrderItemDO> allOrderItems = orderItemMapper.selectByDeletedAndOrderId(orderDelivery.getOrderId(), DeletedStatusEnum.DELETED_NO.getValue());
|
||||
//
|
||||
// // 当前需要发货订单,检查 id 和 status
|
||||
// List<OrderItemDO> needDeliveryOrderItems = allOrderItems.stream()
|
||||
// .filter(orderItemDO -> orderItemIds.contains(orderItemDO.getId())
|
||||
// && OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus())
|
||||
// .collect(Collectors.toList()); // TODO 芋艿,如果这里只是比对数字,可以用 Lambda 求和,不需要弄成一个集合的
|
||||
// // 发货订单,检查
|
||||
// if (needDeliveryOrderItems.size() != orderItemIds.size()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_DELIVERY_INCORRECT_DATA.getCode());
|
||||
// }
|
||||
//
|
||||
// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderDelivery.getOrderId());
|
||||
// OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderRecipientDO);
|
||||
// // 保存物流信息
|
||||
// orderLogisticsDO
|
||||
// .setLogisticsNo(orderDelivery.getLogisticsNo())
|
||||
// .setLogistics(orderDelivery.getLogistics())
|
||||
// .setCreateTime(new Date())
|
||||
// .setUpdateTime(null);
|
||||
// orderLogisticsMapper.insert(orderLogisticsDO);
|
||||
//
|
||||
// // 关联订单item 和 物流信息
|
||||
// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题,然后判断下更新数量,不对,就抛出异常。
|
||||
// orderItemMapper.updateByIds(
|
||||
// orderItemIds,
|
||||
// new OrderItemDO()
|
||||
// .setOrderLogisticsId(orderLogisticsDO.getId())
|
||||
// .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue())
|
||||
// );
|
||||
//
|
||||
// // 子订单是否全部发货,如果发完,就更新 order
|
||||
// List<OrderItemDO> unShippedOrderItems = allOrderItems.stream()
|
||||
// .filter(orderItemDO -> OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus()
|
||||
// && !orderItemIds.contains(orderItemDO.getId()))
|
||||
// .collect(Collectors.toList());
|
||||
// if (unShippedOrderItems.size() <= 0) {
|
||||
// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题
|
||||
// orderMapper.updateById(
|
||||
// new OrderDO()
|
||||
// .setId(orderDelivery.getOrderId())
|
||||
// .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue())
|
||||
// );
|
||||
// }
|
||||
// // 返回成功
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult updateOrderRemake(Integer orderId, String remake) {
|
||||
// // 此处不做订单校验,直接设置备注即可
|
||||
// orderMapper.updateById(new OrderDO().setId(orderId).setRemark(remake));
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional // TODO FROM 芋艿 to 小范,先不做这个功能,电商一班不存在这个功能哈。
|
||||
// public CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO) {
|
||||
// Integer orderId = orderItemDeletedDTO.getOrderId();
|
||||
// List<Integer> orderItemIds = orderItemDeletedDTO.getOrderItemIds();
|
||||
//
|
||||
// // 获取当前有效的订单 item
|
||||
// List<OrderItemDO> orderItemDOList = orderItemMapper
|
||||
// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId);
|
||||
//
|
||||
// List<OrderItemDO> effectiveOrderItems = orderItemDOList.stream()
|
||||
// .filter(orderItemDO -> !orderItemIds.contains(orderItemDO.getId()))
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// // 检查订单 item,必须要有一个 item
|
||||
// if (CollectionUtils.isEmpty(effectiveOrderItems)) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_ITEM_ONLY_ONE.getCode());
|
||||
// }
|
||||
//
|
||||
// // 更新订单 item
|
||||
// orderItemMapper.updateByIds(
|
||||
// orderItemIds,
|
||||
// (OrderItemDO) new OrderItemDO()
|
||||
// .setDeleted(DeletedStatusEnum.DELETED_YES.getValue())
|
||||
// );
|
||||
//
|
||||
// // 更新订单 amount
|
||||
//// Integer totalAmount = orderCommon.calculatedAmount(effectiveOrderItems);
|
||||
// Integer totalAmount = -1; // TODO 芋艿,需要修改下,价格相关
|
||||
// orderMapper.updateById(
|
||||
// new OrderDO()
|
||||
// .setId(orderId)
|
||||
// .setPayAmount(totalAmount)
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult confirmReceiving(Integer userId, Integer orderId) {
|
||||
// OrderDO orderDO = orderMapper.selectById(orderId);
|
||||
//
|
||||
// // 是否该用户的订单
|
||||
// if (!userId.equals(orderDO.getUserId())) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode());
|
||||
// }
|
||||
//
|
||||
// if (OrderStatusEnum.ALREADY_SHIPMENT.getValue() != orderDO.getStatus()) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_UNABLE_CONFIRM_ORDER.getCode());
|
||||
// }
|
||||
//
|
||||
// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题
|
||||
// orderMapper.updateById(
|
||||
// new OrderDO()
|
||||
// .setId(orderId)
|
||||
// .setReceiverTime(new Date())
|
||||
// .setStatus(OrderStatusEnum.COMPLETED.getValue())
|
||||
//
|
||||
// );
|
||||
//
|
||||
// orderItemMapper.updateByOrderId(
|
||||
// orderId,
|
||||
// new OrderItemDO()
|
||||
// .setStatus(OrderStatusEnum.COMPLETED.getValue())
|
||||
// .setReceiverTime(new Date())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO) {
|
||||
// OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDTO);
|
||||
// orderLogisticsMapper.updateById(orderLogisticsDO);
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult deleteOrder(Integer id) {
|
||||
// // 删除订单操作,一般用于 用户端删除,是否存在检查可以过掉
|
||||
// orderMapper.updateById((OrderDO) new OrderDO()
|
||||
// .setId(id)
|
||||
// .setDeleted(DeletedStatusEnum.DELETED_YES.getValue())
|
||||
// );
|
||||
// return CommonResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String updatePaySuccess(String orderId, Integer payAmount) {
|
||||
// OrderDO order = orderMapper.selectById(Integer.valueOf(orderId));
|
||||
// if (order == null) { // 订单不存在
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()).getMessage();
|
||||
// }
|
||||
// if (!order.getStatus().equals(OrderStatusEnum.WAITING_PAYMENT.getValue())) { // 状态不处于等待支付
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_WAITING_PAYMENT.getCode()).getMessage();
|
||||
// }
|
||||
// if (!order.getPresentPrice().equals(payAmount)) { // 支付金额不正确
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_PAY_AMOUNT_ERROR.getCode()).getMessage();
|
||||
// }
|
||||
// // 更新 OrderDO 状态为已支付,等待发货
|
||||
// OrderDO updateOrderObj = new OrderDO()
|
||||
// .setStatus(OrderStatusEnum.WAIT_SHIPMENT.getValue())
|
||||
// .setPayAmount(payAmount)
|
||||
// .setPaymentTime(new Date());
|
||||
// int updateCount = orderMapper.updateByIdAndStatus(order.getId(), order.getStatus(), updateOrderObj);
|
||||
// if (updateCount <= 0) {
|
||||
// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_WAITING_PAYMENT.getCode()).getMessage();
|
||||
// }
|
||||
// // TODO FROM 芋艿 to 小范,把更新 OrderItem 给补全。
|
||||
// return "success";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult listenerConfirmGoods() {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public CommonResult listenerExchangeGoods() {
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
spring:
|
||||
# 数据源配置项
|
||||
datasource:
|
||||
url: jdbc:mysql://s1.iocoder.cn:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
url: jdbc:mysql://s1.iocoder.cn:3306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: 3WLiVUBEwTbvAfsh
|
||||
@@ -16,4 +16,4 @@ mybatis-plus:
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.system.biz.dataobject
|
||||
type-aliases-package: cn.iocoder.mall.order.biz.dataobject
|
||||
|
||||
129
order/order-biz/src/main/resources/mapper/CartMapper.xml
Normal file
129
order/order-biz/src/main/resources/mapper/CartMapper.xml
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.cart.CartMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, status, delete_time, selected, user_id,
|
||||
spu_id, sku_id, quantity, order_id, order_create_time,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="CartItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM cart_item
|
||||
WHERE id = #{id}
|
||||
-- AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByIds" resultType="CartItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM cart_item
|
||||
WHERE id IN
|
||||
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
|
||||
#{id}
|
||||
</foreach>
|
||||
-- AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdAndSkuIdAndStatus" resultType="CartItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM cart_item
|
||||
WHERE user_id = #{userId}
|
||||
AND sku_id = #{skuId}
|
||||
AND status = #{status}
|
||||
-- AND deleted = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdAndStatusAndSelected" resultType="CartItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM cart_item
|
||||
WHERE user_id = #{userId}
|
||||
AND status = #{status}
|
||||
<if test="selected != null">
|
||||
AND selected = #{selected}
|
||||
</if>
|
||||
-- AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectQuantitySumByUserIdAndStatus" resultType="Integer">
|
||||
SELECT
|
||||
SUM(quantity)
|
||||
FROM cart_item
|
||||
WHERE user_id = #{userId}
|
||||
AND status = #{status}
|
||||
-- AND deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="CartItemDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO cart_item (
|
||||
status, delete_time, selected, user_id,
|
||||
spu_id, sku_id, quantity, order_id, order_create_time,
|
||||
create_time
|
||||
) VALUES (
|
||||
#{status}, #{deleteTime}, #{selected}, #{userId},
|
||||
#{spuId}, #{skuId}, #{quantity}, #{orderId}, #{orderCreateTime},
|
||||
#{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="CartItemDO">
|
||||
UPDATE cart_item
|
||||
<set>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="deleteTime != null">
|
||||
delete_time = #{deleteTime},
|
||||
</if>
|
||||
<if test="selected != null">
|
||||
selected = #{selected},
|
||||
</if>
|
||||
<if test="quantity != null">
|
||||
quantity = #{quantity},
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
order_id = #{orderId},
|
||||
</if>
|
||||
<if test="orderCreateTime != null">
|
||||
order_create_time = #{orderCreateTime},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price = #{price},
|
||||
</if>
|
||||
<if test="quantity != null">
|
||||
quantity = #{quantity},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateQuantity" parameterType="CartItemDO">
|
||||
UPDATE cart_item
|
||||
SET quantity = quantity + #{quantityIncr}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateListByUserIdAndSkuId">
|
||||
UPDATE cart_item
|
||||
<set>
|
||||
<if test="selected != null">
|
||||
selected = #{selected},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
</set>
|
||||
WHERE user_id = #{userId}
|
||||
AND sku_id IN
|
||||
<foreach item="skuId" collection="skuIds" separator="," open="(" close=")" index="">
|
||||
#{skuId}
|
||||
</foreach>
|
||||
-- AND deleted = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderCancelMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, order_no, reason, other_reason,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderCancelDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_cancel` (
|
||||
order_id, order_no, reason, other_reason,
|
||||
create_time, update_time
|
||||
) VALUES (
|
||||
#{orderId}, #{orderNo}, #{reason}, #{otherReason},
|
||||
#{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
104
order/order-biz/src/main/resources/mapper/OrderCommentMapper.xml
Normal file
104
order/order-biz/src/main/resources/mapper/OrderCommentMapper.xml
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.comment.OrderCommentMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,order_id,order_no,product_spu_id,product_spu_name,product_sku_id,product_sku_attrs,product_sku_price,product_sku_pic_url,
|
||||
user_id,user_avatar,user_nick_name,star,product_description_star,logistics_star,merchant_star,replay_count,like_count,comment_content,
|
||||
comment_pics,comment_state,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<!--插入-->
|
||||
<insert id="insert" parameterType="OrderCommentDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO order_comment(order_id,order_no,product_spu_id,product_spu_name,product_sku_id,
|
||||
product_sku_attrs,product_sku_price,product_sku_pic_url,user_id,user_avatar,user_nick_name,star,
|
||||
product_description_star,logistics_star,merchant_star,comment_content,comment_pics,comment_state,create_time,update_time)
|
||||
VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs},
|
||||
#{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star},
|
||||
#{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{commentState},#{createTime}, #{updateTime});
|
||||
</insert>
|
||||
|
||||
<!--根据 sku id 获取评论总数-->
|
||||
<select id="selectCommentTotalCountByProductSkuId" parameterType="Integer" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM order_comment
|
||||
WHERE
|
||||
product_sku_id = #{productSkuId}
|
||||
</select>
|
||||
|
||||
<!--分页获取评论分页-->
|
||||
<select id="selectCommentPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
product_sku_id = #{productSkuId}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<!--根据评论 id 获取用户详情-->
|
||||
<select id="selectCommentInfoByCommentId" parameterType="Integer" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<!--分页获取订单评论状态信息详情-->
|
||||
<select id="selectOrderCommentStateInfoPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
user_id = #{userId}
|
||||
AND
|
||||
comment_state = #{commentState}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<!--获取订单评论状态信息详情总数-->
|
||||
<select id="selectOrderCommentStateInfoTotal" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM order_comment
|
||||
WHERE
|
||||
user_id = #{userId}
|
||||
AND
|
||||
comment_state = #{commentState}
|
||||
</select>
|
||||
|
||||
<!--订单评论超时分页-->
|
||||
<select id="selectOrderCommentTimeOutPage" parameterType="cn.iocoder.mall.order.api.dto.OrderCommentTimeOutPageDTO" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
comment_state = #{commentTimeOut.commentState}
|
||||
HAVING
|
||||
TIMESTAMPDIFF(DAY,create_time,NOW()) > #{commentTimeOut.overDay}
|
||||
LIMIT ${commentTimeOut.pageNo*commentTimeOut.pageSize},${commentTimeOut.pageSize}
|
||||
</select>
|
||||
|
||||
<!--批量更新订单评论-->
|
||||
<update id="updateBatchOrderCommentState">
|
||||
UPDATE order_comment
|
||||
SET
|
||||
comment_state = #{commentState}
|
||||
WHERE
|
||||
id
|
||||
IN
|
||||
<if test="list !=null">
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.comment.OrderCommentReplayMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,
|
||||
reply_user_id,reply_user_nick_name,reply_user_avatar,user_type,reply_like_count,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<!--插入-->
|
||||
<insert id="insert" parameterType="OrderCommentReplyDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id,
|
||||
reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time)
|
||||
VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId},
|
||||
#{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime})
|
||||
</insert>
|
||||
|
||||
<!--根据评论 id 和用户类型获取商家回复列表-->
|
||||
<select id="selectCommentMerchantReplyByCommentIdAndUserType" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!--根据评论 id 和用户类型获取评论总数-->
|
||||
<select id="selectCommentReplyTotalCountByCommentId" parameterType="Integer" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
</select>
|
||||
|
||||
<!--分页用户回复-->
|
||||
<select id="selectCommentReplyPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo*pageSize},${pageSize}
|
||||
</select>
|
||||
|
||||
<!--根据评论 id 查询商家最新的评论列表-->
|
||||
<select id="selectCommentNewMerchantReplyByCommentIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
create_time=(SELECT
|
||||
a.maxtime
|
||||
FROM
|
||||
(SELECT
|
||||
MAX(create_time) AS maxtime,comment_id
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id IN
|
||||
<foreach collection="commentIds" item="commentId" separator="," open="(" close=")">
|
||||
#{commentId}
|
||||
</foreach>
|
||||
GROUP BY comment_id ) AS a)
|
||||
AND
|
||||
comment_id IN
|
||||
<foreach collection="commentIds" item="commentId" separator="," open="(" close=")">
|
||||
#{commentId}
|
||||
</foreach>
|
||||
AND
|
||||
user_type = #{userType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
172
order/order-biz/src/main/resources/mapper/OrderItemMapper.xml
Normal file
172
order/order-biz/src/main/resources/mapper/OrderItemMapper.xml
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderItemMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id,
|
||||
quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total,
|
||||
payment_time, delivery_time, receiver_time, closing_time,
|
||||
has_return_exchange, delivery_type, status,
|
||||
create_time, update_time, deleted
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_item` (
|
||||
order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id,
|
||||
quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total,
|
||||
payment_time, delivery_time, receiver_time, closing_time,
|
||||
has_return_exchange, delivery_type, status,
|
||||
create_time, update_time, deleted
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.orderId}, #{item.orderNo}, #{item.skuId}, #{item.skuName}, #{item.skuImage}, #{item.orderLogisticsId},
|
||||
#{item.quantity}, #{item.originPrice}, #{item.buyPrice}, #{item.presentPrice}, #{item.buyTotal}, #{item.discountTotal}, #{item.presentTotal},
|
||||
#{item.paymentTime}, #{item.deliveryTime}, #{item.receiverTime}, #{item.closingTime},
|
||||
#{item.hasReturnExchange}, #{item.deliveryType}, #{item.status},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.deleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--
|
||||
更新 - 可更新的字段
|
||||
-->
|
||||
<sql id="updateFieldSql" >
|
||||
<set>
|
||||
<if test="orderItemDO.orderId != null">
|
||||
, order_id = #{orderItemDO.orderId}
|
||||
</if>
|
||||
<if test="orderItemDO.orderNo != null">
|
||||
, order_no = #{orderItemDO.orderNo}
|
||||
</if>
|
||||
<if test="orderItemDO.orderLogisticsId != null">
|
||||
, order_logistics_id = #{orderItemDO.orderLogisticsId}
|
||||
</if>
|
||||
<if test="orderItemDO.skuId != null">
|
||||
, sku_id = #{orderItemDO.skuId}
|
||||
</if>
|
||||
<if test="orderItemDO.skuName != null">
|
||||
, sku_name = #{orderItemDO.skuName}
|
||||
</if>
|
||||
<if test="orderItemDO.skuImage != null">
|
||||
, sku_image = #{orderItemDO.skuImage}
|
||||
</if>
|
||||
<if test="orderItemDO.quantity != null">
|
||||
, quantity = #{orderItemDO.quantity}
|
||||
</if>
|
||||
<!-- TODO 芋艿 需要改 -->
|
||||
<!-- <if test="orderItemDO.price != null">-->
|
||||
<!-- , price = #{orderItemDO.price}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="orderItemDO.payAmount != null">-->
|
||||
<!-- , pay_amount = #{orderItemDO.payAmount}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="orderItemDO.paymentTime != null">
|
||||
, payment_time = #{orderItemDO.paymentTime}
|
||||
</if>
|
||||
<if test="orderItemDO.deliveryTime != null">
|
||||
, delivery_time = #{orderItemDO.deliveryTime}
|
||||
</if>
|
||||
<if test="orderItemDO.receiverTime != null">
|
||||
, receiver_time = #{orderItemDO.receiverTime}
|
||||
</if>
|
||||
<if test="orderItemDO.closingTime != null">
|
||||
, closing_time = #{orderItemDO.closingTime}
|
||||
</if>
|
||||
|
||||
<if test="orderItemDO.hasReturnExchange != null">
|
||||
, has_return_exchange = #{orderItemDO.hasReturnExchange}
|
||||
</if>
|
||||
<if test="orderItemDO.status != null">
|
||||
, status = #{orderItemDO.status}
|
||||
</if>
|
||||
<if test="orderItemDO.deliveryType != null">
|
||||
, delivery_type = #{orderItemDO.deliveryType}
|
||||
</if>
|
||||
<if test="orderItemDO.deleted != null">
|
||||
, `deleted` = #{orderItemDO.deleted}
|
||||
</if>
|
||||
<if test="orderItemDO.createTime != null">
|
||||
, create_time = #{orderItemDO.createTime}
|
||||
</if>
|
||||
<if test="orderItemDO.updateTime != null">
|
||||
, update_time = #{orderItemDO.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
更新 - 根据 id 更新
|
||||
-->
|
||||
<update id="updateById" parameterType="OrderDO">
|
||||
UPDATE `order_item`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE id = #{orderItemDO.id}
|
||||
</update>
|
||||
|
||||
<!--
|
||||
更新 - 根据 ids 更新
|
||||
-->
|
||||
<update id="updateByIds">
|
||||
UPDATE `order_item`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--
|
||||
更新 - 根据 orderId
|
||||
-->
|
||||
<update id="updateByOrderId">
|
||||
UPDATE `order_item`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<!--
|
||||
获取 - 根据 ids 查询
|
||||
-->
|
||||
<select id="selectByIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_item
|
||||
WHERE `id` IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderId 下的 item
|
||||
-->
|
||||
<select id="selectByDeletedAndOrderId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderItemDO">
|
||||
SELECT * FROM `order_item`
|
||||
WHERE 1=1
|
||||
<if test="deleted != null">
|
||||
AND deleted = #{deleted}
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
AND order_id = #{orderId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderIds 和 status
|
||||
-->
|
||||
<select id="selectByDeletedAndOrderIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderItemDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_item`
|
||||
WHERE `deleted` = #{deleted}
|
||||
AND `order_id`
|
||||
IN
|
||||
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderLogisticsDetailMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,
|
||||
order_logistics_id,
|
||||
logistics_time,
|
||||
logistics_information,
|
||||
create_time,
|
||||
update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入
|
||||
-->
|
||||
<insert id="insert" parameterType="CartItemDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO cart_item (order_logistics_id, logistics_time, logistics_information,
|
||||
create_time, update_time)
|
||||
VALUES (#{orderLogisticsId}, #{logisticsTime}, #{logisticsInformation},
|
||||
#{createTime}, #{updateTime})
|
||||
</insert>
|
||||
|
||||
<!--
|
||||
查询 - 根据 物流id
|
||||
-->
|
||||
<select id="selectByOrderLogisticsId"
|
||||
resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM order_logistics_detail
|
||||
WHERE order_logistics_id = #{orderLogisticsId}
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 物流ids
|
||||
-->
|
||||
<select id="selectByOrderLogisticsIds"
|
||||
resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM order_logistics_detail
|
||||
WHERE order_logistics_id IN
|
||||
<foreach collection="orderLogisticsIds" item="orderLogisticsId" separator="," open="(" close=")">
|
||||
#{orderLogisticsId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 最新的物流信息
|
||||
-->
|
||||
<select id="selectLast" resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM order_logistics_detail
|
||||
WHERE order_logistics_id IN
|
||||
<foreach collection="orderLogisticsIds" item="orderLogisticsId" separator="," open="(" close=")">
|
||||
#{orderLogisticsId}
|
||||
</foreach>
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 0, 1
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 last 根据物理id
|
||||
-->
|
||||
<select id="selectLastByLogisticsId"
|
||||
resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDetailDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM order_logistics_detail
|
||||
WHERE order_logistics_id = #{orderLogisticsId}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderLogisticsMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderLogisticsDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_logistics` (
|
||||
area_no, `name`, mobile, address, logistics, logistics_no, create_time, update_time
|
||||
) VALUES (
|
||||
#{areaNo}, #{name}, #{mobile}, #{address},
|
||||
#{logistics}, #{logisticsNo}, #{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!--
|
||||
可更新字段
|
||||
-->
|
||||
<sql id="updateFieldSql" >
|
||||
<set>
|
||||
<if test="areaNo != null">
|
||||
, area_no = #{areaNo}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
, `name` = #{name}
|
||||
</if>
|
||||
<if test="mobile != null">
|
||||
, mobile = #{mobile}
|
||||
</if>
|
||||
<if test="address != null">
|
||||
, address = #{address}
|
||||
</if>
|
||||
<if test="logistics != null">
|
||||
, logistics = #{logistics}
|
||||
</if>
|
||||
<if test="logisticsNo != null">
|
||||
, logistics_no = #{logisticsNo}
|
||||
</if>
|
||||
</set>
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
更新 - 根据id
|
||||
-->
|
||||
<update id="updateById">
|
||||
UPDATE `order_logistics`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--
|
||||
查询 - 根据 ids
|
||||
-->
|
||||
<select id="selectByIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_logistics`
|
||||
WHERE `id`
|
||||
IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 ids
|
||||
-->
|
||||
<select id="selectById" resultType="cn.iocoder.mall.order.biz.dataobject.OrderLogisticsDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_logistics`
|
||||
WHERE `id` = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
141
order/order-biz/src/main/resources/mapper/OrderMapper.xml
Normal file
141
order/order-biz/src/main/resources/mapper/OrderMapper.xml
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, user_id, order_no, buy_price, discount_price, logistics_price, present_price, pay_amount,
|
||||
payment_time, delivery_time, receiver_time, closing_time,
|
||||
has_return_exchange,
|
||||
status, remark, create_time, update_time, `deleted`
|
||||
</sql>
|
||||
|
||||
<sql id="updateFieldSql" >
|
||||
<set>
|
||||
<if test="orderNo != null">
|
||||
, order_no = #{orderNo}
|
||||
</if>
|
||||
<if test="buyPrice != null">
|
||||
, buy_price = #{buyPrice}
|
||||
</if>
|
||||
<if test="discountPrice != null">
|
||||
, discount_price = #{discountPrice}
|
||||
</if>
|
||||
<if test="logisticsPrice != null">
|
||||
, logistics_price = #{logisticsPrice}
|
||||
</if>
|
||||
<if test="logisticsPrice != null">
|
||||
, logistics_price = #{logisticsPrice}
|
||||
</if>
|
||||
<if test="presentPrice != null">
|
||||
, present_price = #{presentPrice}
|
||||
</if>
|
||||
<if test="payAmount != null">
|
||||
, pay_amount = #{payAmount}
|
||||
</if>
|
||||
<if test="deliveryTime != null">
|
||||
, delivery_time = #{deliveryTime}
|
||||
</if>
|
||||
<if test="paymentTime != null">
|
||||
, payment_time = #{paymentTime}
|
||||
</if>
|
||||
<if test="receiverTime != null">
|
||||
, receiver_time = #{receiverTime}
|
||||
</if>
|
||||
<if test="closingTime != null">
|
||||
, closing_time = #{closingTime}
|
||||
</if>
|
||||
<if test="hasReturnExchange != null">
|
||||
, has_return_exchange = #{hasReturnExchange}
|
||||
</if>
|
||||
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
, remark = #{remark}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
, `deleted` = #{deleted}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
, create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
, update_time = #{updateTime}
|
||||
</if>
|
||||
</set>
|
||||
</sql>
|
||||
|
||||
<update id="updateById" parameterType="OrderDO">
|
||||
UPDATE `orders`
|
||||
<include refid="updateFieldSql" />
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByIdAndStatus">
|
||||
UPDATE `orders`
|
||||
<set>
|
||||
<if test="updateObj.payAmount != null">
|
||||
, pay_amount = #{updateObj.payAmount}
|
||||
</if>
|
||||
<if test="updateObj.paymentTime != null">
|
||||
, payment_time = #{updateObj.paymentTime}
|
||||
</if>
|
||||
<if test="updateObj.status != null">
|
||||
, status = #{updateObj.status}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
AND status = #{status}
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="cn.iocoder.mall.order.biz.dataobject.OrderDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `orders`
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<sql id="selectWhere">
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
AND `user_id` = #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND `id` = #{id}
|
||||
</if>
|
||||
<if test="orderNo != null">
|
||||
AND `order_no` = #{orderNo}
|
||||
</if>
|
||||
<if test="hasReturnExchange != null">
|
||||
AND `has_return_exchange` = #{hasReturnExchange}
|
||||
</if>
|
||||
<if test="startCreateTime != null and endCreateTime != null">
|
||||
AND `create_time` >= #{startCreateTime}
|
||||
AND `create_time` <= #{endCreateTime}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectPageCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM `orders`
|
||||
<where>
|
||||
<include refid="selectWhere" />
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="cn.iocoder.mall.order.biz.dataobject.OrderDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `orders`
|
||||
<where>
|
||||
<include refid="selectWhere" />
|
||||
</where>
|
||||
LIMIT ${pageNo * pageSize}, ${pageSize}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderRecipientMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, `area_no`, `name`, mobile, address, `type`,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderRecipientDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_recipient` (
|
||||
order_id, `area_no`, `name`, mobile, address,
|
||||
`type`, create_time, update_time
|
||||
) VALUES (
|
||||
#{orderId}, #{areaNo}, #{name}, #{mobile}, #{address},
|
||||
#{type}, #{createTime,jdbcType=TIMESTAMP} , #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderId
|
||||
-->
|
||||
<select id="selectByOrderId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_recipient`
|
||||
WHERE order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 orderIds
|
||||
-->
|
||||
<select id="selectByOrderIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM `order_recipient`
|
||||
WHERE order_id IN
|
||||
<foreach collection="orderIds" item="orderId" separator="," open="(" close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
165
order/order-biz/src/main/resources/mapper/OrderReturnMapper.xml
Normal file
165
order/order-biz/src/main/resources/mapper/OrderReturnMapper.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.order.OrderReturnMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,
|
||||
service_number,
|
||||
order_id,
|
||||
order_no,
|
||||
order_logistics_id,
|
||||
refund_price,
|
||||
reason,
|
||||
`describe`,
|
||||
approval_time,
|
||||
refuse_time,
|
||||
logistics_time,
|
||||
receiver_time,
|
||||
closing_time,
|
||||
service_type,
|
||||
status,
|
||||
create_time,
|
||||
update_time
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderReturnDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_return` (
|
||||
service_number, order_id, order_no, order_logistics_id,
|
||||
refund_price, reason, `describe`,
|
||||
approval_time, refuse_time, logistics_time, receiver_time, closing_time,
|
||||
service_type, status,
|
||||
create_time, update_time)
|
||||
VALUES (
|
||||
#{serviceNumber}, #{orderId}, #{orderNo}, #{orderLogisticsId},
|
||||
${refundPrice}, #{reason}, #{describe},
|
||||
#{approvalTime}, #{refuse_time}, #{logisticsTime}, #{receiverTime}, #{closingTime},
|
||||
#{serviceType}, #{status}, #{createTime}, #{updateTime})
|
||||
</insert>
|
||||
|
||||
<!--
|
||||
更新 - 可更新的字段
|
||||
-->
|
||||
<sql id="updateFieldSql">
|
||||
<set>
|
||||
<if test="orderLogisticsId != null">
|
||||
, order_logistics_id = #{orderLogisticsId}
|
||||
</if>
|
||||
<if test="refundPrice != null">
|
||||
, refund_price = #{refundPrice}
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
, reason = #{reason}
|
||||
</if>
|
||||
<if test="describe != null">
|
||||
, `describe` = #{describe}
|
||||
</if>
|
||||
<if test="approvalTime != null">
|
||||
, approval_time = #{approvalTime}
|
||||
</if>
|
||||
<if test="refuseTime != null">
|
||||
, refuse_time = #{refuseTime}
|
||||
</if>
|
||||
<if test="logisticsTime != null">
|
||||
, logistics_time = #{logisticsTime}
|
||||
</if>
|
||||
<if test="receiverTime != null">
|
||||
, receiver_time = #{receiverTime}
|
||||
</if>
|
||||
<if test="closingTime != null">
|
||||
, closing_time = #{closingTime}
|
||||
</if>
|
||||
<if test="serviceType != null">
|
||||
, service_type = #{serviceType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
, create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
, update_time = #{updateTime}
|
||||
</if>
|
||||
</set>
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
更新 - 根据 id 更新
|
||||
-->
|
||||
<update id="updateById" parameterType="OrderReturnDO">
|
||||
UPDATE `order_return`
|
||||
<include refid="updateFieldSql"/>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--
|
||||
查询 - 根据id 查询
|
||||
-->
|
||||
<select id="selectByOrderId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderReturnDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM `order_return`
|
||||
WHERE order_id = #{orderId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!--
|
||||
列表查询 - where
|
||||
-->
|
||||
<sql id="selectListWhere">
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="serviceNumber != null">
|
||||
AND service_number = #{serviceNumber}
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
AND order_id = #{orderId}
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
AND order_no = #{orderNo}
|
||||
</if>
|
||||
<if test="startCreateTime != null and endCreateTime != null">
|
||||
AND create_time >= #{startCreateTime}
|
||||
AND create_time <= #{endCreateTime}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
列表查询 - count
|
||||
-->
|
||||
<select id="selectListCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM `order_return`
|
||||
WHERE 1 = 1
|
||||
<include refid="selectListWhere" />
|
||||
</select>
|
||||
|
||||
|
||||
<!--
|
||||
列表查询 - queryDTO
|
||||
-->
|
||||
<select id="selectList" resultType="cn.iocoder.mall.order.biz.dataobject.OrderReturnDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM `order_return`
|
||||
WHERE 1 = 1
|
||||
<include refid="selectListWhere" />
|
||||
<bind name="limitIndex" value="pageSize * (index - 1)"/>
|
||||
LIMIT #{limitIndex}, #{pageSize}
|
||||
</select>
|
||||
|
||||
<!--
|
||||
查询 - 根据 id 查询
|
||||
-->
|
||||
<select id="selectById" resultType="cn.iocoder.mall.order.biz.dataobject.OrderReturnDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM `order_return`
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user