- 添加 item 删除
- 添加 item 更新 - 添加 错误定义 - 添加 order common
This commit is contained in:
@@ -16,5 +16,11 @@
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.mall.order.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.order.api.bo.OrderBO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderCreateDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderReceiverInformationDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderUpdateDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderItemDeletedDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderLogisticsDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderItemUpdateDTO;
|
||||
|
||||
/**
|
||||
* 订单 service
|
||||
@@ -14,19 +16,28 @@ import cn.iocoder.mall.order.api.dto.OrderUpdateDTO;
|
||||
public interface OrderService {
|
||||
|
||||
/**
|
||||
* 订单创建
|
||||
* 订单 - 创建
|
||||
*
|
||||
* @param orderCreateDTO
|
||||
* @return
|
||||
*/
|
||||
OrderBO createOrder(OrderCreateDTO orderCreateDTO);
|
||||
CommonResult<OrderBO> createOrder(OrderCreateDTO orderCreateDTO);
|
||||
|
||||
/**
|
||||
* 订单更新
|
||||
* 订单item - 更新
|
||||
*
|
||||
* @param orderItemUpdateDTO
|
||||
*
|
||||
* @param orderUpdateDTO
|
||||
*/
|
||||
void updateOrder(OrderUpdateDTO orderUpdateDTO);
|
||||
CommonResult updateOrderItem(OrderItemUpdateDTO orderItemUpdateDTO);
|
||||
|
||||
/**
|
||||
* 订单item - 删除
|
||||
*
|
||||
* @param orderItemDeletedDTO
|
||||
* @return
|
||||
*/
|
||||
CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO);
|
||||
|
||||
/**
|
||||
* 更新订单 - 收件这信息
|
||||
@@ -37,33 +48,33 @@ public interface OrderService {
|
||||
* - 联系人电话
|
||||
* - 联系人姓名
|
||||
*/
|
||||
void updateOrderReceiverInformation(OrderReceiverInformationDTO orderReceiverInfoDTO);
|
||||
CommonResult updateLogistics(OrderLogisticsDTO orderLogisticsDTO);
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void deleteOrder(Integer id);
|
||||
CommonResult deleteOrder(Integer id);
|
||||
|
||||
/**
|
||||
* 监听支付动作
|
||||
*
|
||||
* mq 更新 payStatus
|
||||
*/
|
||||
void listenerPayment();
|
||||
CommonResult listenerPayment();
|
||||
|
||||
/**
|
||||
* 监听确认收货
|
||||
*
|
||||
* mq 更新 status
|
||||
*/
|
||||
void listenerConfirmGoods();
|
||||
CommonResult listenerConfirmGoods();
|
||||
|
||||
/**
|
||||
* 监听换货
|
||||
*
|
||||
* mq 更新 status
|
||||
*/
|
||||
void listenerExchangeGoods();
|
||||
CommonResult listenerExchangeGoods();
|
||||
}
|
||||
|
||||
@@ -19,16 +19,16 @@ public class OrderBO implements Serializable {
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易金额
|
||||
* 订单金额
|
||||
*/
|
||||
private Integer price;
|
||||
private Integer money;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderBO{" +
|
||||
"id=" + id +
|
||||
", orderNo='" + orderNo + '\'' +
|
||||
", price=" + price +
|
||||
", money=" + money +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ public class OrderBO implements Serializable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
public Integer getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public OrderBO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
public OrderBO setMoney(Integer money) {
|
||||
this.money = money;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.iocoder.mall.order.api.constant;
|
||||
|
||||
import cn.iocoder.common.framework.constant.ModuleErrorCodeInterval;
|
||||
|
||||
/**
|
||||
* 错误码区间
|
||||
*
|
||||
* 当前模块化区间:[1-000-001-000 ~ 1-000-002-000]
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 11:35
|
||||
*/
|
||||
public class ErrorCodeInterval extends ModuleErrorCodeInterval {
|
||||
|
||||
// OrderErrorCodeEnum 错误码区间 [1-000-001-000 ~ 1-000-001-100]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.mall.order.api.constant;
|
||||
|
||||
/**
|
||||
* 订单错误码
|
||||
*
|
||||
* 错误码区间 [1-000-001-000 ~ 1-000-002-000]
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-23 11:23
|
||||
*/
|
||||
public enum OrderErrorCodeEnum {
|
||||
|
||||
ORDER_ITEM_ONLY_ONE(1000001000, "订单Item只有一个"),
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
OrderErrorCodeEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public class OrderCreateItemDTO {
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull
|
||||
private String skuId;
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@@ -29,11 +29,11 @@ public class OrderCreateItemDTO {
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getSkuId() {
|
||||
public Integer getSkuId() {
|
||||
return skuId;
|
||||
}
|
||||
|
||||
public OrderCreateItemDTO setSkuId(String skuId) {
|
||||
public OrderCreateItemDTO setSkuId(Integer skuId) {
|
||||
this.skuId = skuId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.mall.order.api.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Sin
|
||||
* @time 2019-03-23 10:22
|
||||
*/
|
||||
public class OrderItemDeletedDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单item id
|
||||
*/
|
||||
private List<Integer> orderItemIds;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderItemDeletedDTO{" +
|
||||
"orderId=" + orderId +
|
||||
", orderItemIds=" + orderItemIds +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public OrderItemDeletedDTO setOrderId(Integer orderId) {
|
||||
this.orderId = orderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Integer> getOrderItemIds() {
|
||||
return orderItemIds;
|
||||
}
|
||||
|
||||
public OrderItemDeletedDTO setOrderItemIds(List<Integer> orderItemIds) {
|
||||
this.orderItemIds = orderItemIds;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.iocoder.mall.order.api.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单更新
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:46
|
||||
*/
|
||||
public class OrderItemUpdateDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull
|
||||
private Integer id;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
@NotNull
|
||||
private Integer price;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderItemUpdateDTO{" +
|
||||
"id=" + id +
|
||||
", skuId=" + skuId +
|
||||
", quantity=" + quantity +
|
||||
", price=" + price +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public OrderItemUpdateDTO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSkuId() {
|
||||
return skuId;
|
||||
}
|
||||
|
||||
public OrderItemUpdateDTO setSkuId(Integer skuId) {
|
||||
this.skuId = skuId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public OrderItemUpdateDTO setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public OrderItemUpdateDTO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package cn.iocoder.mall.order.api.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单收件人信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-17 20:22
|
||||
*/
|
||||
public class OrderLogisticsDTO 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;
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
@NotNull
|
||||
private String logisticsNo;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderLogisticsDTO{" +
|
||||
"id=" + id +
|
||||
", areaNo='" + areaNo + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", mobile='" + mobile + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", logisticsNo='" + logisticsNo + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAreaNo() {
|
||||
return areaNo;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setAreaNo(String areaNo) {
|
||||
this.areaNo = areaNo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setAddress(String address) {
|
||||
this.address = address;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLogisticsNo() {
|
||||
return logisticsNo;
|
||||
}
|
||||
|
||||
public OrderLogisticsDTO setLogisticsNo(String logisticsNo) {
|
||||
this.logisticsNo = logisticsNo;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package cn.iocoder.mall.order.api.dto;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单收件人信息
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-17 20:22
|
||||
*/
|
||||
public class OrderReceiverInformationDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 订单 id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
@NotNull
|
||||
private String receiverAreaNo;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
@NotNull
|
||||
private String receiverName;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
@NotNull
|
||||
@Size(max = 11, min = 11)
|
||||
// TODO: 2019-03-17 Sin 此处需要添加 手机号校验,需要添加新的注解
|
||||
private String receiverMobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
@NotNull
|
||||
@Size(max = 250, min = 10, message = "收件地址应该在 10 ~ 250 个字符之间")
|
||||
private String receiverAddress;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderReceiverInformationDTO{" +
|
||||
"id=" + id +
|
||||
", receiverAreaNo='" + receiverAreaNo + '\'' +
|
||||
", receiverName='" + receiverName + '\'' +
|
||||
", receiverMobile='" + receiverMobile + '\'' +
|
||||
", receiverAddress='" + receiverAddress + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public OrderReceiverInformationDTO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReceiverAreaNo() {
|
||||
return receiverAreaNo;
|
||||
}
|
||||
|
||||
public OrderReceiverInformationDTO setReceiverAreaNo(String receiverAreaNo) {
|
||||
this.receiverAreaNo = receiverAreaNo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReceiverName() {
|
||||
return receiverName;
|
||||
}
|
||||
|
||||
public OrderReceiverInformationDTO setReceiverName(String receiverName) {
|
||||
this.receiverName = receiverName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReceiverMobile() {
|
||||
return receiverMobile;
|
||||
}
|
||||
|
||||
public OrderReceiverInformationDTO setReceiverMobile(String receiverMobile) {
|
||||
this.receiverMobile = receiverMobile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReceiverAddress() {
|
||||
return receiverAddress;
|
||||
}
|
||||
|
||||
public OrderReceiverInformationDTO setReceiverAddress(String receiverAddress) {
|
||||
this.receiverAddress = receiverAddress;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package cn.iocoder.mall.order.api.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单更新
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:46
|
||||
*/
|
||||
public class OrderUpdateDTO implements Serializable {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user