添加 order 临时提交,写完 api dataObject 和一些定义,为实现
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.order.dao;
|
||||
|
||||
import cn.iocoder.mall.order.dataobject.OrderDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单 mapper
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:09
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderMapper {
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param orderDO
|
||||
*/
|
||||
void insert(OrderDO orderDO);
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package cn.iocoder.mall.order.dataobject;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 13:49
|
||||
*/
|
||||
public class OrderDO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 收件区域编号
|
||||
*/
|
||||
private String receiverAreaNo;
|
||||
/**
|
||||
* 收件手机号
|
||||
*/
|
||||
private String receiverMobile;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String receiverAddress;
|
||||
/**
|
||||
* 状态(如果有多个商品分开发货需要全部商品发完才会改变状态)
|
||||
*
|
||||
* - 0、代发货
|
||||
* - 1、已发货
|
||||
* - 2、已收货
|
||||
* - 20、换货中
|
||||
* - 21、换货成功
|
||||
* - 40、退货中
|
||||
* - 41、已退货
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 支付状态
|
||||
*
|
||||
* - 0、待支付
|
||||
* - 1、支付完成
|
||||
* - 2、已退款
|
||||
*/
|
||||
private Integer payStatus;
|
||||
/**
|
||||
* 订单创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 付款时间
|
||||
*/
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 成交时间
|
||||
*/
|
||||
private Date closingTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Order{" +
|
||||
"id='" + id + '\'' +
|
||||
", orderNo='" + orderNo + '\'' +
|
||||
", price=" + price +
|
||||
", receiverAreaNo='" + receiverAreaNo + '\'' +
|
||||
", receiverMobile='" + receiverMobile + '\'' +
|
||||
", receiverAddress='" + receiverAddress + '\'' +
|
||||
", status=" + status +
|
||||
", payStatus=" + payStatus +
|
||||
", createTime=" + createTime +
|
||||
", paymentTime=" + paymentTime +
|
||||
", deliveryTime=" + deliveryTime +
|
||||
", closingTime=" + closingTime +
|
||||
", remark='" + remark + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Integer price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getReceiverAreaNo() {
|
||||
return receiverAreaNo;
|
||||
}
|
||||
|
||||
public void setReceiverAreaNo(String receiverAreaNo) {
|
||||
this.receiverAreaNo = receiverAreaNo;
|
||||
}
|
||||
|
||||
public String getReceiverMobile() {
|
||||
return receiverMobile;
|
||||
}
|
||||
|
||||
public void setReceiverMobile(String receiverMobile) {
|
||||
this.receiverMobile = receiverMobile;
|
||||
}
|
||||
|
||||
public String getReceiverAddress() {
|
||||
return receiverAddress;
|
||||
}
|
||||
|
||||
public void setReceiverAddress(String receiverAddress) {
|
||||
this.receiverAddress = receiverAddress;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getPayStatus() {
|
||||
return payStatus;
|
||||
}
|
||||
|
||||
public void setPayStatus(Integer payStatus) {
|
||||
this.payStatus = payStatus;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getPaymentTime() {
|
||||
return paymentTime;
|
||||
}
|
||||
|
||||
public void setPaymentTime(Date paymentTime) {
|
||||
this.paymentTime = paymentTime;
|
||||
}
|
||||
|
||||
public Date getDeliveryTime() {
|
||||
return deliveryTime;
|
||||
}
|
||||
|
||||
public void setDeliveryTime(Date deliveryTime) {
|
||||
this.deliveryTime = deliveryTime;
|
||||
}
|
||||
|
||||
public Date getClosingTime() {
|
||||
return closingTime;
|
||||
}
|
||||
|
||||
public void setClosingTime(Date closingTime) {
|
||||
this.closingTime = closingTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package cn.iocoder.mall.order.dataobject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单 item
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 14:03
|
||||
*/
|
||||
public class OrderItemDO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private String commodityId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* - 0、代发货
|
||||
* - 1、已发货
|
||||
* - 2、已收货
|
||||
* - 20、换货中
|
||||
* - 21、换货成功
|
||||
* - 40、退货中
|
||||
* - 41、已退货
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderItem{" +
|
||||
"id='" + id + '\'' +
|
||||
", orderId='" + orderId + '\'' +
|
||||
", commodityId='" + commodityId + '\'' +
|
||||
", quantity=" + quantity +
|
||||
", price=" + price +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getCommodityId() {
|
||||
return commodityId;
|
||||
}
|
||||
|
||||
public void setCommodityId(String commodityId) {
|
||||
this.commodityId = commodityId;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Integer price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @author Sin
|
||||
* @time 2019-03-16 13:49
|
||||
*/
|
||||
package cn.iocoder.mall.order;
|
||||
@@ -0,0 +1,16 @@
|
||||
package cn.iocoder.mall.order.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单 service impl
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019-03-16 15:08
|
||||
*/
|
||||
@Service
|
||||
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
|
||||
public class ServiceImpl {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://180.167.213.26:13306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
|
||||
# mybatis
|
||||
mybatis:
|
||||
config-location: classpath:mybatis-config.xml
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.order.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
application:
|
||||
name: order-service
|
||||
registry:
|
||||
address: zookeeper://127.0.0.1:2181
|
||||
protocol:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.order.service
|
||||
@@ -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.OrderMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, order_no, price, receiver_area_no, receiver_mobile,
|
||||
receiver_address, status, pay_status, create_time,
|
||||
payment_time, delivery_time, closing_time, remark
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="OrderDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO order (
|
||||
id, order_no, price, receiver_area_no, receiver_mobile,
|
||||
receiver_address, status, pay_status, create_time,
|
||||
payment_time, delivery_time, closing_time, remark
|
||||
) VALUES (
|
||||
${orderNo}, ${price}, ${receiverAreaNo}, ${receiverMobile},
|
||||
${receiverAddress}, ${status}, ${payStatus}, ${createTime},
|
||||
${paymentTime}, ${deliveryTime}, ${closingTime}, ${remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
|
||||
<settings>
|
||||
<!-- 使用驼峰命名法转换字段。 -->
|
||||
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||
</settings>
|
||||
|
||||
<typeAliases>
|
||||
<typeAlias alias="Integer" type="java.lang.Integer"/>
|
||||
<typeAlias alias="Long" type="java.lang.Long"/>
|
||||
<typeAlias alias="HashMap" type="java.util.HashMap"/>
|
||||
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap"/>
|
||||
<typeAlias alias="ArrayList" type="java.util.ArrayList"/>
|
||||
<typeAlias alias="LinkedList" type="java.util.LinkedList"/>
|
||||
</typeAliases>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user