From 41674407ab8cdff8cea2da4e6c450501dab90e03 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 20 Mar 2019 17:50:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20Serializable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/iocoder/common/framework/dataobject/BaseDO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/dataobject/BaseDO.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/dataobject/BaseDO.java index 54cf1c7bb..4629484f2 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/dataobject/BaseDO.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/dataobject/BaseDO.java @@ -1,11 +1,12 @@ package cn.iocoder.common.framework.dataobject; +import java.io.Serializable; import java.util.Date; /** * 基础实体对象 */ -public class BaseDO { +public class BaseDO implements Serializable { /** * 是否删除 - 是 From 2ee7004f6e668c8180bf3f88d51e719c295e0a85 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 20 Mar 2019 17:53:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?-=20=E8=B0=83=E6=95=B4=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20=E6=94=B9=E4=B8=BA=20extends=20BaseDO=20-?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E8=AE=A2=E5=8D=95=E7=BB=93=E6=9E=84=20?= =?UTF-8?q?=E5=90=88=E5=B9=B6=20hasReturnExchange=20=E7=8A=B6=E6=80=81=20-?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=20=E9=80=80=E8=B4=A7=E6=8D=A2=E8=B4=A7=20?= =?UTF-8?q?=E5=95=86=E5=93=81id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/order/dataobject/OrderDO.java | 60 ++++++------------- .../order/dataobject/OrderExchangeDO.java | 33 +++++++++- .../mall/order/dataobject/OrderItemDO.java | 26 ++++---- .../order/dataobject/OrderLogisticsDO.java | 4 +- .../dataobject/OrderLogisticsDetailDO.java | 5 +- .../mall/order/dataobject/OrderReturnDO.java | 19 +++++- 6 files changed, 85 insertions(+), 62 deletions(-) diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java index 730620ddd..ba3a9014e 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java @@ -1,5 +1,7 @@ package cn.iocoder.mall.order.dataobject; +import cn.iocoder.common.framework.dataobject.BaseDO; + import java.io.Serializable; import java.util.Date; @@ -9,7 +11,7 @@ import java.util.Date; * @author Sin * @time 2019-03-16 13:49 */ -public class OrderDO implements Serializable { +public class OrderDO extends BaseDO { /** * id @@ -31,10 +33,6 @@ public class OrderDO implements Serializable { /// /// 时间信息 - /** - * 创建时间 - */ - private Date createTime; /** * 付款时间 */ @@ -58,24 +56,20 @@ public class OrderDO implements Serializable { /** * 是否退货 * - * - 0、no - * - 1、yes + * - 0、没有 + * - 1、换货 + * - 2、退货 + * - 3、换货 + 退货 */ - private Integer hasReturn; - /** - * 是否换货 - * - * - 0、no - * - 1、yes - */ - private Integer hasExchange; + private Integer hasReturnExchange; /** * 状态(如果有多个商品分开发货需要全部商品发完才会改变状态) * - * - 0、代付款 - * - 1、已付款 - * - 2、已退款 + * - 0、待付款 + * - 1、待发货 + * - 2、待收获 * - 3、已完成 + * - 4、已关闭 */ private Integer status; /** @@ -97,13 +91,11 @@ public class OrderDO implements Serializable { ", orderLogisticsId=" + orderLogisticsId + ", orderNo='" + orderNo + '\'' + ", price=" + price + - ", createTime=" + createTime + ", paymentTime=" + paymentTime + ", deliveryTime=" + deliveryTime + ", receiverTime=" + receiverTime + ", closingTime=" + closingTime + - ", hasReturn=" + hasReturn + - ", hasExchange=" + hasExchange + + ", hasReturnExchange=" + hasReturnExchange + ", status=" + status + ", deleteStatus=" + deleteStatus + ", remark='" + remark + '\'' + @@ -146,15 +138,6 @@ public class OrderDO implements Serializable { return this; } - public Date getCreateTime() { - return createTime; - } - - public OrderDO setCreateTime(Date createTime) { - this.createTime = createTime; - return this; - } - public Date getPaymentTime() { return paymentTime; } @@ -191,21 +174,12 @@ public class OrderDO implements Serializable { return this; } - public Integer getHasReturn() { - return hasReturn; + public Integer getHasReturnExchange() { + return hasReturnExchange; } - public OrderDO setHasReturn(Integer hasReturn) { - this.hasReturn = hasReturn; - return this; - } - - public Integer getHasExchange() { - return hasExchange; - } - - public OrderDO setHasExchange(Integer hasExchange) { - this.hasExchange = hasExchange; + public OrderDO setHasReturnExchange(Integer hasReturnExchange) { + this.hasReturnExchange = hasReturnExchange; return this; } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java index a157b8ede..dfba3c91f 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java @@ -1,6 +1,7 @@ package cn.iocoder.mall.order.dataobject; -import java.io.Serializable; +import cn.iocoder.common.framework.dataobject.BaseDO; + import java.util.Date; /** @@ -9,7 +10,7 @@ import java.util.Date; * @author Sin * @time 2019-03-19 19:48 */ -public class OrderExchangeDO implements Serializable { +public class OrderExchangeDO extends BaseDO { /** * id @@ -23,6 +24,14 @@ public class OrderExchangeDO implements Serializable { * 订单编号 */ private String orderNo; + /** + * 商品id(保存一个冗余,如果一个订单下存在多个商品,会有很大的作用) + */ + private String skuId; + /** + * 换货商品id + */ + private String exchangeSkuId; /** * 换货物流id */ @@ -76,6 +85,8 @@ public class OrderExchangeDO implements Serializable { "id=" + id + ", orderId=" + orderId + ", orderNo='" + orderNo + '\'' + + ", skuId='" + skuId + '\'' + + ", exchangeSkuId='" + exchangeSkuId + '\'' + ", exchangeOrderLogisticsId=" + exchangeOrderLogisticsId + ", receiverOrderLogisticsId=" + receiverOrderLogisticsId + ", createTime=" + createTime + @@ -114,6 +125,24 @@ public class OrderExchangeDO implements Serializable { return this; } + public String getSkuId() { + return skuId; + } + + public OrderExchangeDO setSkuId(String skuId) { + this.skuId = skuId; + return this; + } + + public String getExchangeSkuId() { + return exchangeSkuId; + } + + public OrderExchangeDO setExchangeSkuId(String exchangeSkuId) { + this.exchangeSkuId = exchangeSkuId; + return this; + } + public Integer getExchangeOrderLogisticsId() { return exchangeOrderLogisticsId; } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java index e4ef2dfc4..7c463e7f5 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java @@ -1,6 +1,7 @@ package cn.iocoder.mall.order.dataobject; -import java.io.Serializable; +import cn.iocoder.common.framework.dataobject.BaseDO; + import java.util.Date; /** @@ -9,7 +10,7 @@ import java.util.Date; * @author Sin * @time 2019-03-16 14:03 */ -public class OrderItemDO implements Serializable { +public class OrderItemDO extends BaseDO { /** * 编号 @@ -26,7 +27,7 @@ public class OrderItemDO implements Serializable { /** * 商品编号 */ - private String commodityId; + private String skuId; /** * 数量 */ @@ -80,10 +81,11 @@ public class OrderItemDO implements Serializable { /** * 状态 * - * - 0、代付款 - * - 1、已付款 - * - 2、已退款 + * - 0、待付款 + * - 1、待发货 + * - 2、待收获 * - 3、已完成 + * - 4、已关闭 */ private Integer status; @@ -93,7 +95,7 @@ public class OrderItemDO implements Serializable { "id=" + id + ", orderId=" + orderId + ", orderNo='" + orderNo + '\'' + - ", commodityId='" + commodityId + '\'' + + ", skuId='" + skuId + '\'' + ", quantity=" + quantity + ", price=" + price + ", createTime=" + createTime + @@ -134,12 +136,12 @@ public class OrderItemDO implements Serializable { return this; } - public String getCommodityId() { - return commodityId; + public String getSkuId() { + return skuId; } - public OrderItemDO setCommodityId(String commodityId) { - this.commodityId = commodityId; + public OrderItemDO setSkuId(String skuId) { + this.skuId = skuId; return this; } @@ -161,10 +163,12 @@ public class OrderItemDO implements Serializable { return this; } + @Override public Date getCreateTime() { return createTime; } + @Override public OrderItemDO setCreateTime(Date createTime) { this.createTime = createTime; return this; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDO.java index 2b7cadc24..fc4cffd65 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.order.dataobject; -import java.io.Serializable; +import cn.iocoder.common.framework.dataobject.BaseDO; /** * 订单物流信息 @@ -8,7 +8,7 @@ import java.io.Serializable; * @author Sin * @time 2019-03-19 20:47 */ -public class OrderLogisticsDO implements Serializable { +public class OrderLogisticsDO extends BaseDO { /** * id diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDetailDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDetailDO.java index efafa3153..6e461b455 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDetailDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderLogisticsDetailDO.java @@ -1,6 +1,7 @@ package cn.iocoder.mall.order.dataobject; -import java.io.Serializable; +import cn.iocoder.common.framework.dataobject.BaseDO; + import java.util.Date; /** @@ -11,7 +12,7 @@ import java.util.Date; * @author Sin * @time 2019-03-19 20:48 */ -public class OrderLogisticsDetailDO implements Serializable { +public class OrderLogisticsDetailDO extends BaseDO { /** * id diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java index b5f98edea..c0df58fc3 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java @@ -1,6 +1,7 @@ package cn.iocoder.mall.order.dataobject; -import java.io.Serializable; +import cn.iocoder.common.framework.dataobject.BaseDO; + import java.util.Date; /** @@ -9,7 +10,7 @@ import java.util.Date; * @author Sin * @time 2019-03-19 19:48 */ -public class OrderReturnDO implements Serializable { +public class OrderReturnDO extends BaseDO { /** * 编号自动增长 @@ -27,6 +28,10 @@ public class OrderReturnDO implements Serializable { * 订单 item 编号 */ private Integer orderItemId; + /** + * 商品编号(保存一个冗余,如果一个订单下存在多个商品,会有很大的作用) + */ + private String skuId; /// /// 时间信息 @@ -80,6 +85,7 @@ public class OrderReturnDO implements Serializable { ", orderId=" + orderId + ", orderNo='" + orderNo + '\'' + ", orderItemId=" + orderItemId + + ", skuId='" + skuId + '\'' + ", createTime=" + createTime + ", approvalTime=" + approvalTime + ", logisticsTime=" + logisticsTime + @@ -126,6 +132,15 @@ public class OrderReturnDO implements Serializable { return this; } + public String getSkuId() { + return skuId; + } + + public OrderReturnDO setSkuId(String skuId) { + this.skuId = skuId; + return this; + } + public Date getCreateTime() { return createTime; } From 8df0b3fa6c3fce89d509cf6098155a6f90ddce60 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 20 Mar 2019 21:42:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?-=20=E6=B7=BB=E5=8A=A0=E9=80=80=E8=B4=A7?= =?UTF-8?q?=EF=BC=8C=E6=8D=A2=E8=B4=A7=E5=8E=9F=E5=9B=A0=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=20enum=20=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/OrderExchangeReasonEnum.java | 40 ++++++++++++++ .../constants/OrderReturnReasonEnum.java | 52 +++++++++++++++++++ .../mall/order/constants/package-info.java | 7 +++ .../order/dataobject/OrderExchangeDO.java | 38 ++++++++++++++ .../mall/order/dataobject/OrderReturnDO.java | 38 ++++++++++++++ .../iocoder/mall/order/dataobject/README.md | 18 ++++++- 6 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderExchangeReasonEnum.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderReturnReasonEnum.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/package-info.java diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderExchangeReasonEnum.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderExchangeReasonEnum.java new file mode 100644 index 000000000..a83879416 --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderExchangeReasonEnum.java @@ -0,0 +1,40 @@ +package cn.iocoder.mall.order.constants; + +/** + * 订单换货原因 + * + * @author Sin + * @time 2019-03-20 21:17 + */ +public enum OrderExchangeReasonEnum { + + REASON_000(0, "其他"), + REASON_001(1, "尺码不合适"), + REASON_002(2, "质量问题"), + REASON_003(3, "不喜欢"), + ; + + private Integer value; + + private String name; + + OrderExchangeReasonEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String toString() { + return "OrderCommonReasonEnum{" + + "value=" + value + + ", name=" + name + + '}'; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + }} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderReturnReasonEnum.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderReturnReasonEnum.java new file mode 100644 index 000000000..6e6751892 --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/OrderReturnReasonEnum.java @@ -0,0 +1,52 @@ +package cn.iocoder.mall.order.constants; + +/** + * 订单退货原因 + * + * @author Sin + * @time 2019-03-20 21:17 + */ +public enum OrderReturnReasonEnum { + + /// + /// 未发货情况 + + REASON_000(0, "其他"), + REASON_001(1, "拍错/勿拍/多拍"), + REASON_002(2, "缺货"), + + /// + /// 已发货情况 + + REASON_020(20, "七天无理由"), + REASON_021(21, "质量问题"), + REASON_022(22, "不想要了"), + + ; + + // TODO: 2019-03-20 Sin 已发货情况 补全,需要对照一下 淘宝 + + private Integer value; + + private String name; + + OrderReturnReasonEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String toString() { + return "OrderCommonReasonEnum{" + + "value=" + value + + ", name=" + name + + '}'; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + }} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/package-info.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/package-info.java new file mode 100644 index 000000000..5d683d051 --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/constants/package-info.java @@ -0,0 +1,7 @@ +/** + * 定义常量,以及枚举信息 + * + * @author Sin + * @time 2019-03-20 21:16 + */ +package cn.iocoder.mall.order.constants; \ No newline at end of file diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java index dfba3c91f..f01e392e6 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderExchangeDO.java @@ -41,6 +41,22 @@ public class OrderExchangeDO extends BaseDO { */ private Integer receiverOrderLogisticsId; + /// + /// 原因 + + /** + * 原因 (关联字典) + * + * {@link cn.iocoder.mall.order.constants.OrderExchangeReasonEnum} + */ + private Integer orderReasonId; + /** + * 原因(如果选择其他,原因保存在这) + * + * {@link cn.iocoder.mall.order.constants.OrderExchangeReasonEnum#REASON_000} + */ + private String reason; + /// /// 时间信息 @@ -89,6 +105,8 @@ public class OrderExchangeDO extends BaseDO { ", exchangeSkuId='" + exchangeSkuId + '\'' + ", exchangeOrderLogisticsId=" + exchangeOrderLogisticsId + ", receiverOrderLogisticsId=" + receiverOrderLogisticsId + + ", orderReasonId=" + orderReasonId + + ", reason='" + reason + '\'' + ", createTime=" + createTime + ", paymentTime=" + paymentTime + ", deliveryTime=" + deliveryTime + @@ -161,10 +179,30 @@ public class OrderExchangeDO extends BaseDO { return this; } + public Integer getOrderReasonId() { + return orderReasonId; + } + + public OrderExchangeDO setOrderReasonId(Integer orderReasonId) { + this.orderReasonId = orderReasonId; + return this; + } + + public String getReason() { + return reason; + } + + public OrderExchangeDO setReason(String reason) { + this.reason = reason; + return this; + } + + @Override public Date getCreateTime() { return createTime; } + @Override public OrderExchangeDO setCreateTime(Date createTime) { this.createTime = createTime; return this; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java index c0df58fc3..3e6714d87 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderReturnDO.java @@ -33,6 +33,22 @@ public class OrderReturnDO extends BaseDO { */ private String skuId; + /// + /// 退货原因 + + /** + * 退货原因(字典值) + * + * {@link cn.iocoder.mall.order.constants.OrderReturnReasonEnum} + */ + private Integer orderReasonId; + /** + * 原因(如果选择其他,原因保存在这) + * + * {@link cn.iocoder.mall.order.constants.OrderReturnReasonEnum#REASON_000} + */ + private String reason; + /// /// 时间信息 @@ -86,6 +102,8 @@ public class OrderReturnDO extends BaseDO { ", orderNo='" + orderNo + '\'' + ", orderItemId=" + orderItemId + ", skuId='" + skuId + '\'' + + ", orderReasonId=" + orderReasonId + + ", reason='" + reason + '\'' + ", createTime=" + createTime + ", approvalTime=" + approvalTime + ", logisticsTime=" + logisticsTime + @@ -141,10 +159,30 @@ public class OrderReturnDO extends BaseDO { return this; } + public Integer getOrderReasonId() { + return orderReasonId; + } + + public OrderReturnDO setOrderReasonId(Integer orderReasonId) { + this.orderReasonId = orderReasonId; + return this; + } + + public String getReason() { + return reason; + } + + public OrderReturnDO setReason(String reason) { + this.reason = reason; + return this; + } + + @Override public Date getCreateTime() { return createTime; } + @Override public OrderReturnDO setCreateTime(Date createTime) { this.createTime = createTime; return this; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/README.md b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/README.md index 9648f3929..f42e41382 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/README.md +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/README.md @@ -2,4 +2,20 @@ ## 订单 -TODO \ No newline at end of file +TODO + + +**退货** + +1. 商家未发货,退货原因 + + - 拍错/勿拍/多拍 + - 缺货 + +2. 商家已发货,退货原因 + + - 七天无理由 + - 质量问题 + - 不想要了 + - 其他 + \ No newline at end of file