首页添加 我的订单;订单添加各个步骤的事件字段
This commit is contained in:
@@ -17,4 +17,7 @@ public class Order {
|
||||
private String orderStatus;
|
||||
private BigDecimal orderPrice;
|
||||
private LocalDateTime payDate;
|
||||
private LocalDateTime cancelDate;
|
||||
private LocalDateTime shipDate;
|
||||
private LocalDateTime deliverDate;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,10 @@ public class OrderVO implements Serializable {
|
||||
private String orderStatus;
|
||||
private String orderStatusCode;
|
||||
private String orderPrice;
|
||||
private LocalDateTime payDate;
|
||||
private String payDate;
|
||||
private String cancelDate;
|
||||
private String shipDate;
|
||||
private String deliverDate;
|
||||
|
||||
public static OrderVO convertFrom(Order order) {
|
||||
if (order == null) {
|
||||
@@ -41,6 +44,19 @@ public class OrderVO implements Serializable {
|
||||
orderVO.setOrderStatusCode(order.getOrderStatus());
|
||||
String price = order.getOrderPrice().setScale(2, RoundingMode.FLOOR).toPlainString();
|
||||
orderVO.setOrderPrice(price);
|
||||
|
||||
if (order.getOrderDate() != null) {
|
||||
orderVO.setPayDate(order.getOrderDate().toString().replace("T", " "));
|
||||
}
|
||||
if (order.getCancelDate() != null) {
|
||||
orderVO.setCancelDate(order.getCancelDate().toString().replace("T", " "));
|
||||
}
|
||||
if (order.getShipDate() != null) {
|
||||
orderVO.setShipDate(order.getShipDate().toString().replace("T", " "));
|
||||
}
|
||||
if (order.getDeliverDate() != null) {
|
||||
orderVO.setDeliverDate(order.getDeliverDate().toString().replace("T", " "));
|
||||
}
|
||||
return orderVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ public class Controller {
|
||||
public HashMap<String, Object> WxMiniProgramAuditSpecialHandle() {
|
||||
boolean showCode = true;
|
||||
boolean showShop = true;
|
||||
|
||||
// 底部 tabbar
|
||||
LinkedList<String> tabbarItem = new LinkedList<>();
|
||||
tabbarItem.push("pages/index/index");
|
||||
if (showCode) tabbarItem.push("pages/residents/code");
|
||||
@@ -30,12 +32,14 @@ public class Controller {
|
||||
if (showShop) tabbarItem.push("pages/shop/shop");
|
||||
tabbarItem.push("pages/person/person");
|
||||
|
||||
// 首页显示按钮
|
||||
LinkedList<String> indexItem = new LinkedList<>();
|
||||
indexItem.push("/pages/index/login");
|
||||
if (showCode) indexItem.push("/pages/residents/code");
|
||||
if (showCode) indexItem.push("scanQRCode");
|
||||
indexItem.push("/pages/residents/report");
|
||||
if (showShop) indexItem.push("/pages/shop/shop");
|
||||
if (showShop) indexItem.push("/pages/shop/myOrder");
|
||||
indexItem.push("/pages/person/person");
|
||||
indexItem.push("/pages/person/updpwd");
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface OrderDao {
|
||||
* 更新订单状态
|
||||
*
|
||||
* @param orderId
|
||||
* @param status
|
||||
* @param orderStatus
|
||||
* @return
|
||||
*/
|
||||
int updateOrderStatus(@Param("orderId") Long orderId, @Param("orderStatus") String orderStatus);
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="order_date" property="orderDate"/>
|
||||
<result column="order_status" property="orderStatus"/>
|
||||
<result column="order_price" property="orderPrice"/>
|
||||
<result column="pay_date" property="payDate"/>
|
||||
<result column="cancel_date" property="cancelDate"/>
|
||||
<result column="ship_date" property="shipDate"/>
|
||||
<result column="deliver_date" property="deliverDate"/>
|
||||
</resultMap>
|
||||
<resultMap id="OrderDetailResultMap" type="com.cxyxiaomo.epp.common.pojo.OrderDetail">
|
||||
<id property="id" column="id"/>
|
||||
@@ -68,6 +73,22 @@
|
||||
<update id="updateOrderStatus" parameterType="com.cxyxiaomo.epp.common.pojo.Order">
|
||||
UPDATE `order`
|
||||
SET order_status = #{orderStatus}
|
||||
# 如果取消订单,那么更新 cancel_date
|
||||
<if test="orderStatus == 'Cancelled'">
|
||||
, cancel_date = CURRENT_TIMESTAMP
|
||||
</if>
|
||||
# 如果支付完成,那么更新 pay_date
|
||||
<if test="orderStatus == 'Processing'">
|
||||
, pay_date = CURRENT_TIMESTAMP
|
||||
</if>
|
||||
# 如果已经发货,那么更新 ship_date
|
||||
<if test="orderStatus == 'Shipped'">
|
||||
, ship_date = CURRENT_TIMESTAMP
|
||||
</if>
|
||||
# 如果已经确认收货,那么更新 deliver_date
|
||||
<if test="orderStatus == 'Delivered'">
|
||||
, deliver_date = CURRENT_TIMESTAMP
|
||||
</if>
|
||||
WHERE id = #{orderId} LIMIT 1
|
||||
</update>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user