- 添加订单 创建、更新收件人信息 操作

This commit is contained in:
sin
2019-03-17 21:08:14 +08:00
parent ba7669f3a2
commit b1b70318dc
18 changed files with 496 additions and 50 deletions

View File

@@ -2,6 +2,7 @@ package cn.iocoder.mall.order.api;
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;
/**
@@ -27,12 +28,23 @@ public interface OrderService {
*/
void updateOrder(OrderUpdateDTO orderUpdateDTO);
/**
* 更新订单 - 收件这信息
*
* 包含:
* - 详细地址
* - 区域编号
* - 联系人电话
* - 联系人姓名
*/
void updateOrderReceiverInformation(OrderReceiverInformationDTO orderReceiverInfoDTO);
/**
* 删除订单
*
* @param orderId
* @param id
*/
void deleteOrder(String orderId);
void deleteOrder(Integer id);
/**
* 监听支付动作

View File

@@ -9,4 +9,53 @@ import java.io.Serializable;
* @time 2019-03-16 14:38
*/
public class OrderBO implements Serializable {
/**
* 编号
*/
private Integer id;
/**
* 订单编号
*/
private String orderNo;
/**
* 交易金额
*/
private Integer price;
@Override
public String toString() {
return "OrderBO{" +
"id=" + id +
", orderNo='" + orderNo + '\'' +
", price=" + price +
'}';
}
public Integer getId() {
return id;
}
public OrderBO setId(Integer id) {
this.id = id;
return this;
}
public String getOrderNo() {
return orderNo;
}
public OrderBO setOrderNo(String orderNo) {
this.orderNo = orderNo;
return this;
}
public Integer getPrice() {
return price;
}
public OrderBO setPrice(Integer price) {
this.price = price;
return this;
}
}

View File

@@ -0,0 +1,31 @@
package cn.iocoder.mall.order.api.constants;
/**
* 订单 deleteStatus
*
* @author Sin
* @time 2019-03-17 20:58
*/
public enum OrderDeleteStatusEnum {
DELETE_NO(0, "正常"),
DELETE_YES(1, "已删除")
;
private final int value;
private final String name;
OrderDeleteStatusEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -17,10 +17,18 @@ public enum OrderPayStatusEnum {
private final int value;
private final String text;
private final String name;
OrderPayStatusEnum(int value, String text) {
OrderPayStatusEnum(int value, String name) {
this.value = value;
this.text = text;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -28,9 +28,18 @@ public enum OrderStatusEnum {
private final int value;
private final String text;
private final String name;
OrderStatusEnum(int value, String text) {
OrderStatusEnum(int value, String name) {
this.value = value;
this.text = text;
}}
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -18,6 +18,11 @@ public class OrderCreateDTO implements Serializable {
*/
@NotNull
private String receiverAreaNo;
/**
* 收件人名称
*/
@NotNull
private String receiverName;
/**
* 收件手机号
*/
@@ -44,6 +49,7 @@ public class OrderCreateDTO implements Serializable {
public String toString() {
return "OrderCreateDTO{" +
"receiverAreaNo='" + receiverAreaNo + '\'' +
", receiverName='" + receiverName + '\'' +
", receiverMobile='" + receiverMobile + '\'' +
", receiverAddress='" + receiverAddress + '\'' +
", remark='" + remark + '\'' +
@@ -60,6 +66,15 @@ public class OrderCreateDTO implements Serializable {
return this;
}
public String getReceiverName() {
return receiverName;
}
public OrderCreateDTO setReceiverName(String receiverName) {
this.receiverName = receiverName;
return this;
}
public String getReceiverMobile() {
return receiverMobile;
}

View File

@@ -0,0 +1,99 @@
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;
}
}

View File

@@ -9,4 +9,8 @@ import java.io.Serializable;
* @time 2019-03-16 14:46
*/
public class OrderUpdateDTO implements Serializable {
}