Преглед на файлове

添加订单列表接口

zhh преди 6 години
родител
ревизия
8705320127

+ 5 - 4
mall-admin/src/main/java/com/macro/mall/controller/OmsOrderController.java

@@ -1,6 +1,7 @@
 package com.macro.mall.controller;
 
 import com.macro.mall.dto.CommonResult;
+import com.macro.mall.dto.OmsOrderDeliveryParam;
 import com.macro.mall.dto.OmsOrderDetail;
 import com.macro.mall.dto.OmsOrderQueryParam;
 import com.macro.mall.model.OmsOrder;
@@ -37,8 +38,8 @@ public class OmsOrderController {
     @ApiOperation("批量发货")
     @RequestMapping(value = "/update/delivery", method = RequestMethod.POST)
     @ResponseBody
-    public Object delivery(@RequestParam("ids") List<Long> ids) {
-        int count = orderService.delivery(ids);
+    public Object delivery(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList) {
+        int count = orderService.delivery(deliveryParamList);
         if (count > 0) {
             return new CommonResult().success(count);
         }
@@ -48,8 +49,8 @@ public class OmsOrderController {
     @ApiOperation("批量关闭订单")
     @RequestMapping(value = "/update/close", method = RequestMethod.POST)
     @ResponseBody
-    public Object close(@RequestParam("ids") List<Long> ids) {
-        int count = orderService.close(ids);
+    public Object close(@RequestParam("ids") List<Long> ids,@RequestParam String note) {
+        int count = orderService.close(ids,note);
         if (count > 0) {
             return new CommonResult().success(count);
         }

+ 30 - 0
mall-admin/src/main/java/com/macro/mall/dao/OmsOrderDao.java

@@ -0,0 +1,30 @@
+package com.macro.mall.dao;
+
+import com.macro.mall.dto.OmsOrderDeliveryParam;
+import com.macro.mall.dto.OmsOrderDetail;
+import com.macro.mall.dto.OmsOrderQueryParam;
+import com.macro.mall.model.OmsOrder;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 订单自定义查询Dao
+ * Created by macro on 2018/10/12.
+ */
+public interface OmsOrderDao {
+    /**
+     * 条件查询订单
+     */
+    List<OmsOrder> getList(@Param("queryParam") OmsOrderQueryParam queryParam);
+
+    /**
+     * 批量发货
+     */
+    int delivery(@Param("list") List<OmsOrderDeliveryParam> deliveryParamList);
+
+    /**
+     * 获取订单详情
+     */
+    OmsOrderDetail getDetail(@Param("id") Long id);
+}

+ 14 - 0
mall-admin/src/main/java/com/macro/mall/dao/OmsOrderOperateHistoryDao.java

@@ -0,0 +1,14 @@
+package com.macro.mall.dao;
+
+import com.macro.mall.model.OmsOrderOperateHistory;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 订单操作记录自定义Dao
+ * Created by macro on 2018/10/12.
+ */
+public interface OmsOrderOperateHistoryDao {
+    int insertList(@Param("list") List<OmsOrderOperateHistory> orderOperateHistoryList);
+}

+ 20 - 0
mall-admin/src/main/java/com/macro/mall/dto/OmsOrderDeliveryParam.java

@@ -0,0 +1,20 @@
+package com.macro.mall.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 订单发货参数
+ * Created by macro on 2018/10/12.
+ */
+@Getter
+@Setter
+public class OmsOrderDeliveryParam {
+    @ApiModelProperty("订单id")
+    private Long orderId;
+    @ApiModelProperty("物流公司")
+    private String deliveryCompany;
+    @ApiModelProperty("物流单号")
+    private String deliverySn;
+}

+ 1 - 3
mall-admin/src/main/java/com/macro/mall/dto/OmsOrderQueryParam.java

@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.util.Date;
-
 /**
  * 订单查询参数
  * Created by macro on 2018/10/11.
@@ -24,5 +22,5 @@ public class OmsOrderQueryParam {
     @ApiModelProperty(value = "订单来源:0->PC订单;1->app订单")
     private Integer sourceType;
     @ApiModelProperty(value = "订单提交时间")
-    private Date createTime;
+    private String createTime;
 }

+ 6 - 2
mall-admin/src/main/java/com/macro/mall/service/OmsOrderService.java

@@ -1,8 +1,10 @@
 package com.macro.mall.service;
 
+import com.macro.mall.dto.OmsOrderDeliveryParam;
 import com.macro.mall.dto.OmsOrderDetail;
 import com.macro.mall.dto.OmsOrderQueryParam;
 import com.macro.mall.model.OmsOrder;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -19,12 +21,14 @@ public interface OmsOrderService {
     /**
      * 批量发货
      */
-    int delivery(List<Long> ids);
+    @Transactional
+    int delivery(List<OmsOrderDeliveryParam> deliveryParamList);
 
     /**
      * 批量关闭订单
      */
-    int close(List<Long> ids);
+    @Transactional
+    int close(List<Long> ids, String note);
 
     /**
      * 批量删除订单

+ 51 - 29
mall-admin/src/main/java/com/macro/mall/service/impl/OmsOrderServiceImpl.java

@@ -1,20 +1,22 @@
 package com.macro.mall.service.impl;
 
-import com.aliyun.oss.common.utils.DateUtil;
 import com.github.pagehelper.PageHelper;
+import com.macro.mall.dao.OmsOrderDao;
+import com.macro.mall.dao.OmsOrderOperateHistoryDao;
+import com.macro.mall.dto.OmsOrderDeliveryParam;
 import com.macro.mall.dto.OmsOrderDetail;
 import com.macro.mall.dto.OmsOrderQueryParam;
 import com.macro.mall.mapper.OmsOrderMapper;
 import com.macro.mall.model.OmsOrder;
 import com.macro.mall.model.OmsOrderExample;
+import com.macro.mall.model.OmsOrderOperateHistory;
 import com.macro.mall.service.OmsOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
 
-import java.time.LocalTime;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 订单管理Service实现类
@@ -24,47 +26,67 @@ import java.util.List;
 public class OmsOrderServiceImpl implements OmsOrderService {
     @Autowired
     private OmsOrderMapper orderMapper;
+    @Autowired
+    private OmsOrderDao orderDao;
+    @Autowired
+    private OmsOrderOperateHistoryDao orderOperateHistoryDao;
+
     @Override
     public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
-        PageHelper.startPage(pageNum,pageSize);
-        OmsOrderExample example = new OmsOrderExample();
-        OmsOrderExample.Criteria criteria = example.createCriteria();
-        criteria.andDeleteStatusEqualTo(0);
-        if(!StringUtils.isEmpty(queryParam.getOrderSn())){
-            criteria.andOrderSnEqualTo(queryParam.getOrderSn());
-        }
-        if(!StringUtils.isEmpty(queryParam.getReceiverKeyword())){
-            criteria.andReceiverNameEqualTo(queryParam.getReceiverKeyword());
-        }
-        if(queryParam.getStatus()!=null){
-            criteria.andStatusEqualTo(queryParam.getStatus());
-        }
-        if(queryParam.getSourceType()!=null){
-            criteria.andSourceTypeEqualTo(queryParam.getSourceType());
-        }
-        if(queryParam.getOrderType()!=null){
-            criteria.andOrderTypeEqualTo(queryParam.getOrderType());
-        }
-        return orderMapper.selectByExample(example);
+        PageHelper.startPage(pageNum, pageSize);
+        return orderDao.getList(queryParam);
     }
 
     @Override
-    public int delivery(List<Long> ids) {
-        return 0;
+    public int delivery(List<OmsOrderDeliveryParam> deliveryParamList) {
+        //批量发货
+        int count = orderDao.delivery(deliveryParamList);
+        //添加操作记录
+        List<OmsOrderOperateHistory> operateHistoryList = deliveryParamList.stream()
+                .map(omsOrderDeliveryParam -> {
+                    OmsOrderOperateHistory history = new OmsOrderOperateHistory();
+                    history.setOrderId(omsOrderDeliveryParam.getOrderId());
+                    history.setCreateTime(new Date());
+                    history.setOperateMan("后台管理员");
+                    history.setOrderStatus(2);
+                    history.setNote("完成发货");
+                    return history;
+                }).collect(Collectors.toList());
+        orderOperateHistoryDao.insertList(operateHistoryList);
+        return count;
     }
 
     @Override
-    public int close(List<Long> ids) {
-        return 0;
+    public int close(List<Long> ids, String note) {
+        OmsOrder record = new OmsOrder();
+        record.setStatus(4);
+        OmsOrderExample example = new OmsOrderExample();
+        example.createCriteria().andDeleteStatusEqualTo(0).andIdIn(ids);
+        int count = orderMapper.updateByExampleSelective(record, example);
+        List<OmsOrderOperateHistory> historyList = ids.stream().map(orderId -> {
+            OmsOrderOperateHistory history = new OmsOrderOperateHistory();
+            history.setOrderId(orderId);
+            history.setCreateTime(new Date());
+            history.setOperateMan("后台管理员");
+            history.setOrderStatus(4);
+            history.setNote("订单关闭:"+note);
+            return history;
+        }).collect(Collectors.toList());
+        orderOperateHistoryDao.insertList(historyList);
+        return count;
     }
 
     @Override
     public int delete(List<Long> ids) {
-        return 0;
+        OmsOrder record = new OmsOrder();
+        record.setDeleteStatus(1);
+        OmsOrderExample example = new OmsOrderExample();
+        example.createCriteria().andDeleteStatusEqualTo(0).andIdIn(ids);
+        return orderMapper.updateByExampleSelective(record, example);
     }
 
     @Override
     public OmsOrderDetail detail(Long id) {
-        return null;
+        return orderDao.getDetail(id);
     }
 }

+ 91 - 0
mall-admin/src/main/resources/dao/OmsOrderDao.xml

@@ -0,0 +1,91 @@
+<?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="com.macro.mall.dao.OmsOrderDao">
+    <resultMap id="orderDetailResultMap" type="com.macro.mall.dto.OmsOrderDetail" extends="com.macro.mall.mapper.OmsOrderMapper.BaseResultMap">
+        <collection property="orderItemList" resultMap="com.macro.mall.mapper.OmsOrderItemMapper.BaseResultMap" columnPrefix="item_"/>
+        <collection property="historyList" resultMap="com.macro.mall.mapper.OmsOrderOperateHistoryMapper.BaseResultMap" columnPrefix="history_"/>
+    </resultMap>
+    <select id="getList" resultMap="com.macro.mall.mapper.OmsOrderMapper.BaseResultMap">
+        SELECT *
+        FROM
+        oms_order
+        WHERE
+        delete_status = 0
+        <if test="queryParam.orderSn!=null and queryParam.orderSn!=''">
+            AND order_sn = #{queryParam.orderSn}
+        </if>
+        <if test="queryParam.status!=null">
+            AND `status` = #{queryParam.status}
+        </if>
+        <if test="queryParam.sourceType!=null">
+            AND source_type = #{queryParam.sourceType}
+        </if>
+        <if test="queryParam.orderType!=null">
+            AND order_type = #{queryParam.orderType}
+        </if>
+        <if test="queryParam.createTime!=null and queryParam.createTime!=''">
+            AND create_time LIKE concat(#{queryParam.createTime},"%")
+        </if>
+        <if test="queryParam.receiverKeyword!=null and queryParam.receiverKeyword!=''">
+            AND (
+            receiver_name LIKE concat("%",#{queryParam.receiverKeyword},"%")
+            OR receiver_phone LIKE concat("%",#{queryParam.receiverKeyword},"%")
+            )
+        </if>
+    </select>
+    <update id="delivery">
+        UPDATE oms_order
+        SET
+        delivery_sn = CASE id
+        <foreach collection="list" item="item">
+            WHEN #{item.orderId} THEN #{item.deliverySn}
+        </foreach>
+        END,
+        delivery_company = CASE id
+        <foreach collection="list" item="item">
+            WHEN #{item.orderId} THEN #{item.deliveryCompany}
+        </foreach>
+        END,
+        delivery_time = CASE id
+        <foreach collection="list" item="item">
+            WHEN #{item.orderId} THEN now()
+        </foreach>
+        END,
+        `status` = CASE id
+        <foreach collection="list" item="item">
+            WHEN #{item.orderId} THEN 2
+        </foreach>
+        END
+        WHERE
+        id IN
+        <foreach collection="list" item="item" separator="," open="(" close=")">
+            #{item.orderId}
+        </foreach>
+        AND `status` = 1
+    </update>
+    <select id="getDetail" resultMap="orderDetailResultMap">
+        SELECT o.*,
+            oi.id item_id,
+            oi.product_id item_product_id,
+            oi.product_sn item_product_sn,
+            oi.product_pic item_product_pic,
+            oi.product_name item_product_name,
+            oi.product_brand item_product_brand,
+            oi.product_price item_product_price,
+            oi.product_quantity item_product_quantity,
+            oi.sp1 item_sp1,
+            oi.sp2 item_sp2,
+            oi.sp3 item_sp3,
+            oh.id history_id,
+            oh.operate_man history_operate_man,
+            oh.create_time history_create_time,
+            oh.order_status history_order_status,
+            oh.note history_note
+        FROM
+            oms_order o
+            LEFT JOIN oms_order_item oi ON o.id = oi.order_id
+            LEFT JOIN oms_order_operate_history oh ON o.id = oh.order_id
+        WHERE
+            o.id = #{id}
+    </select>
+</mapper>

+ 14 - 0
mall-admin/src/main/resources/dao/OmsOrderOperateHistoryDao.xml

@@ -0,0 +1,14 @@
+<?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="com.macro.mall.dao.OmsOrderOperateHistoryDao">
+    <insert id="insertList">
+        INSERT INTO oms_order_operate_history (order_id, operate_man, create_time, order_status, note) VALUES
+        <foreach collection="list" separator="," item="item" index="index">
+            (#{item.orderId},
+            #{item.operateMan},
+            #{item.createTime,jdbcType=TIMESTAMP},
+            #{item.orderStatus},
+            #{item.note})
+        </foreach>
+    </insert>
+</mapper>

+ 80 - 0
mall-mbg/src/main/java/com/macro/mall/model/OmsOrder.java

@@ -268,6 +268,41 @@ public class OmsOrder implements Serializable {
      */
     private Integer useIntegration;
 
+    /**
+     * 支付时间
+     *
+     * @mbggenerated
+     */
+    private Date paymentTime;
+
+    /**
+     * 发货时间
+     *
+     * @mbggenerated
+     */
+    private Date deliveryTime;
+
+    /**
+     * 确认收货时间
+     *
+     * @mbggenerated
+     */
+    private Date receiveTime;
+
+    /**
+     * 评价时间
+     *
+     * @mbggenerated
+     */
+    private Date commentTime;
+
+    /**
+     * 修改时间
+     *
+     * @mbggenerated
+     */
+    private Date modifyTime;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -582,6 +617,46 @@ public class OmsOrder implements Serializable {
         this.useIntegration = useIntegration;
     }
 
+    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 getReceiveTime() {
+        return receiveTime;
+    }
+
+    public void setReceiveTime(Date receiveTime) {
+        this.receiveTime = receiveTime;
+    }
+
+    public Date getCommentTime() {
+        return commentTime;
+    }
+
+    public void setCommentTime(Date commentTime) {
+        this.commentTime = commentTime;
+    }
+
+    public Date getModifyTime() {
+        return modifyTime;
+    }
+
+    public void setModifyTime(Date modifyTime) {
+        this.modifyTime = modifyTime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -627,6 +702,11 @@ public class OmsOrder implements Serializable {
         sb.append(", confirmStatus=").append(confirmStatus);
         sb.append(", deleteStatus=").append(deleteStatus);
         sb.append(", useIntegration=").append(useIntegration);
+        sb.append(", paymentTime=").append(paymentTime);
+        sb.append(", deliveryTime=").append(deliveryTime);
+        sb.append(", receiveTime=").append(receiveTime);
+        sb.append(", commentTime=").append(commentTime);
+        sb.append(", modifyTime=").append(modifyTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 300 - 0
mall-mbg/src/main/java/com/macro/mall/model/OmsOrderExample.java

@@ -2615,6 +2615,306 @@ public class OmsOrderExample {
             addCriterion("use_integration not between", value1, value2, "useIntegration");
             return (Criteria) this;
         }
+
+        public Criteria andPaymentTimeIsNull() {
+            addCriterion("payment_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeIsNotNull() {
+            addCriterion("payment_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeEqualTo(Date value) {
+            addCriterion("payment_time =", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeNotEqualTo(Date value) {
+            addCriterion("payment_time <>", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeGreaterThan(Date value) {
+            addCriterion("payment_time >", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("payment_time >=", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeLessThan(Date value) {
+            addCriterion("payment_time <", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeLessThanOrEqualTo(Date value) {
+            addCriterion("payment_time <=", value, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeIn(List<Date> values) {
+            addCriterion("payment_time in", values, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeNotIn(List<Date> values) {
+            addCriterion("payment_time not in", values, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeBetween(Date value1, Date value2) {
+            addCriterion("payment_time between", value1, value2, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPaymentTimeNotBetween(Date value1, Date value2) {
+            addCriterion("payment_time not between", value1, value2, "paymentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeIsNull() {
+            addCriterion("delivery_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeIsNotNull() {
+            addCriterion("delivery_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeEqualTo(Date value) {
+            addCriterion("delivery_time =", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeNotEqualTo(Date value) {
+            addCriterion("delivery_time <>", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeGreaterThan(Date value) {
+            addCriterion("delivery_time >", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("delivery_time >=", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeLessThan(Date value) {
+            addCriterion("delivery_time <", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeLessThanOrEqualTo(Date value) {
+            addCriterion("delivery_time <=", value, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeIn(List<Date> values) {
+            addCriterion("delivery_time in", values, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeNotIn(List<Date> values) {
+            addCriterion("delivery_time not in", values, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeBetween(Date value1, Date value2) {
+            addCriterion("delivery_time between", value1, value2, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryTimeNotBetween(Date value1, Date value2) {
+            addCriterion("delivery_time not between", value1, value2, "deliveryTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeIsNull() {
+            addCriterion("receive_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeIsNotNull() {
+            addCriterion("receive_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeEqualTo(Date value) {
+            addCriterion("receive_time =", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeNotEqualTo(Date value) {
+            addCriterion("receive_time <>", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeGreaterThan(Date value) {
+            addCriterion("receive_time >", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("receive_time >=", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeLessThan(Date value) {
+            addCriterion("receive_time <", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeLessThanOrEqualTo(Date value) {
+            addCriterion("receive_time <=", value, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeIn(List<Date> values) {
+            addCriterion("receive_time in", values, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeNotIn(List<Date> values) {
+            addCriterion("receive_time not in", values, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeBetween(Date value1, Date value2) {
+            addCriterion("receive_time between", value1, value2, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiveTimeNotBetween(Date value1, Date value2) {
+            addCriterion("receive_time not between", value1, value2, "receiveTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeIsNull() {
+            addCriterion("comment_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeIsNotNull() {
+            addCriterion("comment_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeEqualTo(Date value) {
+            addCriterion("comment_time =", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeNotEqualTo(Date value) {
+            addCriterion("comment_time <>", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeGreaterThan(Date value) {
+            addCriterion("comment_time >", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("comment_time >=", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeLessThan(Date value) {
+            addCriterion("comment_time <", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeLessThanOrEqualTo(Date value) {
+            addCriterion("comment_time <=", value, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeIn(List<Date> values) {
+            addCriterion("comment_time in", values, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeNotIn(List<Date> values) {
+            addCriterion("comment_time not in", values, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeBetween(Date value1, Date value2) {
+            addCriterion("comment_time between", value1, value2, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCommentTimeNotBetween(Date value1, Date value2) {
+            addCriterion("comment_time not between", value1, value2, "commentTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNull() {
+            addCriterion("modify_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNotNull() {
+            addCriterion("modify_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeEqualTo(Date value) {
+            addCriterion("modify_time =", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotEqualTo(Date value) {
+            addCriterion("modify_time <>", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThan(Date value) {
+            addCriterion("modify_time >", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("modify_time >=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThan(Date value) {
+            addCriterion("modify_time <", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThanOrEqualTo(Date value) {
+            addCriterion("modify_time <=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIn(List<Date> values) {
+            addCriterion("modify_time in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotIn(List<Date> values) {
+            addCriterion("modify_time not in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeBetween(Date value1, Date value2) {
+            addCriterion("modify_time between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotBetween(Date value1, Date value2) {
+            addCriterion("modify_time not between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 17 - 0
mall-mbg/src/main/java/com/macro/mall/model/OmsOrderReturnReason.java

@@ -1,6 +1,7 @@
 package com.macro.mall.model;
 
 import java.io.Serializable;
+import java.util.Date;
 
 public class OmsOrderReturnReason implements Serializable {
     private Long id;
@@ -21,6 +22,13 @@ public class OmsOrderReturnReason implements Serializable {
      */
     private Integer status;
 
+    /**
+     * 添加时间
+     *
+     * @mbggenerated
+     */
+    private Date createTime;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -55,6 +63,14 @@ public class OmsOrderReturnReason implements Serializable {
         this.status = status;
     }
 
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -65,6 +81,7 @@ public class OmsOrderReturnReason implements Serializable {
         sb.append(", name=").append(name);
         sb.append(", sort=").append(sort);
         sb.append(", status=").append(status);
+        sb.append(", createTime=").append(createTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 61 - 0
mall-mbg/src/main/java/com/macro/mall/model/OmsOrderReturnReasonExample.java

@@ -1,6 +1,7 @@
 package com.macro.mall.model;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 public class OmsOrderReturnReasonExample {
@@ -353,6 +354,66 @@ public class OmsOrderReturnReasonExample {
             addCriterion("status not between", value1, value2, "status");
             return (Criteria) this;
         }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 84 - 5
mall-mbg/src/main/resources/com/macro/mall/mapper/OmsOrderMapper.xml

@@ -41,6 +41,11 @@
     <result column="confirm_status" jdbcType="INTEGER" property="confirmStatus" />
     <result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
     <result column="use_integration" jdbcType="INTEGER" property="useIntegration" />
+    <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
+    <result column="delivery_time" jdbcType="TIMESTAMP" property="deliveryTime" />
+    <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime" />
+    <result column="comment_time" jdbcType="TIMESTAMP" property="commentTime" />
+    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -107,7 +112,7 @@
     integration, growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone, 
     bill_receiver_email, receiver_name, receiver_phone, receiver_post_code, receiver_province, 
     receiver_city, receiver_region, receiver_detail_address, note, confirm_status, delete_status, 
-    use_integration
+    use_integration, payment_time, delivery_time, receive_time, comment_time, modify_time
   </sql>
   <select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderExample" resultMap="BaseResultMap">
     select
@@ -155,7 +160,9 @@
       receiver_name, receiver_phone, receiver_post_code, 
       receiver_province, receiver_city, receiver_region, 
       receiver_detail_address, note, confirm_status, 
-      delete_status, use_integration)
+      delete_status, use_integration, payment_time, 
+      delivery_time, receive_time, comment_time, 
+      modify_time)
     values (#{memberId,jdbcType=BIGINT}, #{couponId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=TIMESTAMP}, #{memberUsername,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, 
       #{payAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL}, #{promotionAmount,jdbcType=DECIMAL}, 
@@ -168,7 +175,9 @@
       #{receiverName,jdbcType=VARCHAR}, #{receiverPhone,jdbcType=VARCHAR}, #{receiverPostCode,jdbcType=VARCHAR}, 
       #{receiverProvince,jdbcType=VARCHAR}, #{receiverCity,jdbcType=VARCHAR}, #{receiverRegion,jdbcType=VARCHAR}, 
       #{receiverDetailAddress,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{confirmStatus,jdbcType=INTEGER}, 
-      #{deleteStatus,jdbcType=INTEGER}, #{useIntegration,jdbcType=INTEGER})
+      #{deleteStatus,jdbcType=INTEGER}, #{useIntegration,jdbcType=INTEGER}, #{paymentTime,jdbcType=TIMESTAMP}, 
+      #{deliveryTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, #{commentTime,jdbcType=TIMESTAMP}, 
+      #{modifyTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrder">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -290,6 +299,21 @@
       <if test="useIntegration != null">
         use_integration,
       </if>
+      <if test="paymentTime != null">
+        payment_time,
+      </if>
+      <if test="deliveryTime != null">
+        delivery_time,
+      </if>
+      <if test="receiveTime != null">
+        receive_time,
+      </if>
+      <if test="commentTime != null">
+        comment_time,
+      </if>
+      <if test="modifyTime != null">
+        modify_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="memberId != null">
@@ -406,6 +430,21 @@
       <if test="useIntegration != null">
         #{useIntegration,jdbcType=INTEGER},
       </if>
+      <if test="paymentTime != null">
+        #{paymentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="deliveryTime != null">
+        #{deliveryTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="commentTime != null">
+        #{commentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.macro.mall.model.OmsOrderExample" resultType="java.lang.Integer">
@@ -534,6 +573,21 @@
       <if test="record.useIntegration != null">
         use_integration = #{record.useIntegration,jdbcType=INTEGER},
       </if>
+      <if test="record.paymentTime != null">
+        payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.deliveryTime != null">
+        delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.receiveTime != null">
+        receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.commentTime != null">
+        comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.modifyTime != null">
+        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -579,7 +633,12 @@
       note = #{record.note,jdbcType=VARCHAR},
       confirm_status = #{record.confirmStatus,jdbcType=INTEGER},
       delete_status = #{record.deleteStatus,jdbcType=INTEGER},
-      use_integration = #{record.useIntegration,jdbcType=INTEGER}
+      use_integration = #{record.useIntegration,jdbcType=INTEGER},
+      payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
+      delivery_time = #{record.deliveryTime,jdbcType=TIMESTAMP},
+      receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
+      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -701,6 +760,21 @@
       <if test="useIntegration != null">
         use_integration = #{useIntegration,jdbcType=INTEGER},
       </if>
+      <if test="paymentTime != null">
+        payment_time = #{paymentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="deliveryTime != null">
+        delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="commentTime != null">
+        comment_time = #{commentTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -743,7 +817,12 @@
       note = #{note,jdbcType=VARCHAR},
       confirm_status = #{confirmStatus,jdbcType=INTEGER},
       delete_status = #{deleteStatus,jdbcType=INTEGER},
-      use_integration = #{useIntegration,jdbcType=INTEGER}
+      use_integration = #{useIntegration,jdbcType=INTEGER},
+      payment_time = #{paymentTime,jdbcType=TIMESTAMP},
+      delivery_time = #{deliveryTime,jdbcType=TIMESTAMP},
+      receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      comment_time = #{commentTime,jdbcType=TIMESTAMP},
+      modify_time = #{modifyTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 22 - 7
mall-mbg/src/main/resources/com/macro/mall/mapper/OmsOrderReturnReasonMapper.xml

@@ -6,6 +6,7 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="sort" jdbcType="INTEGER" property="sort" />
     <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -66,7 +67,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, name, sort, status
+    id, name, sort, status, create_time
   </sql>
   <select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderReturnReasonExample" resultMap="BaseResultMap">
     select
@@ -102,10 +103,10 @@
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
       SELECT LAST_INSERT_ID()
     </selectKey>
-    insert into oms_order_return_reason (name, sort, status
-      )
-    values (#{name,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}
-      )
+    insert into oms_order_return_reason (name, sort, status, 
+      create_time)
+    values (#{name,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrderReturnReason">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -122,6 +123,9 @@
       <if test="status != null">
         status,
       </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="name != null">
@@ -133,6 +137,9 @@
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.macro.mall.model.OmsOrderReturnReasonExample" resultType="java.lang.Integer">
@@ -156,6 +163,9 @@
       <if test="record.status != null">
         status = #{record.status,jdbcType=INTEGER},
       </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -166,7 +176,8 @@
     set id = #{record.id,jdbcType=BIGINT},
       name = #{record.name,jdbcType=VARCHAR},
       sort = #{record.sort,jdbcType=INTEGER},
-      status = #{record.status,jdbcType=INTEGER}
+      status = #{record.status,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -183,6 +194,9 @@
       <if test="status != null">
         status = #{status,jdbcType=INTEGER},
       </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -190,7 +204,8 @@
     update oms_order_return_reason
     set name = #{name,jdbcType=VARCHAR},
       sort = #{sort,jdbcType=INTEGER},
-      status = #{status,jdbcType=INTEGER}
+      status = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 1 - 0
mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPortalOrderServiceImpl.java

@@ -230,6 +230,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
         OmsOrder order = new OmsOrder();
         order.setId(orderId);
         order.setStatus(1);
+        order.setPaymentTime(new Date());
         orderMapper.updateByPrimaryKeySelective(order);
         //恢复所有下单商品的锁定库存,扣减真实库存
         OmsOrderDetail orderDetail = portalOrderDao.getDetail(orderId);