parent
ba7669f3a2
commit
b1b70318dc
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.order.dao;
|
||||
|
||||
import cn.iocoder.mall.order.dataobject.OrderItemDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单 item mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:09
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderItemMapper {
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param orderItemDO
|
||||
*/
|
||||
void insert(OrderItemDO orderItemDO);
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
<?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.dao.OrderItemMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_id, commodity_id, quantity, price,
|
||||
status, deliveryTime
|
||||
</sql>
|
||||
|
||||
<!--
|
||||
插入数据
|
||||
-->
|
||||
<insert id="insert" parameterType="OrderItemDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO `order_item` (
|
||||
order_id, commodity_id, quantity, price,
|
||||
status, deliveryTime
|
||||
) VALUES (
|
||||
#{orderId}, #{commodityId}, #{quantity}, #{price},
|
||||
#{status}, #{deliveryTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in new issue