完善了订单接口
This commit is contained in:
parent
8ef61448a1
commit
9e031c3bfb
|
@ -17,6 +17,11 @@ public class OrderAddRequest implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址信息快照
|
* 地址信息快照
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
package com.cultural.heritage.model.dto.order;
|
package com.cultural.heritage.model.dto.order;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|
||||||
import com.cultural.heritage.common.PageRequest;
|
import com.cultural.heritage.common.PageRequest;
|
||||||
import com.cultural.heritage.model.dto.snapshot.AddressSnapshot;
|
|
||||||
import com.cultural.heritage.model.dto.snapshot.ContactsSnapshot;
|
|
||||||
import com.cultural.heritage.model.dto.snapshot.CouponSnapshot;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -24,6 +17,11 @@ public class OrderQueryRequest extends PageRequest implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String OrderNumber;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单最小金额
|
* 订单最小金额
|
||||||
|
|
|
@ -31,6 +31,11 @@ public class Order implements Serializable {
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String OrderNumber;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
|
|
|
@ -10,7 +10,6 @@ import com.cultural.heritage.model.dto.order.OrderQueryRequest;
|
||||||
import com.cultural.heritage.model.entity.Order;
|
import com.cultural.heritage.model.entity.Order;
|
||||||
import com.cultural.heritage.service.order.OrderService;
|
import com.cultural.heritage.service.order.OrderService;
|
||||||
import com.cultural.heritage.utils.SqlUtils;
|
import com.cultural.heritage.utils.SqlUtils;
|
||||||
import io.netty.util.internal.StringUtil;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -33,6 +32,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||||
Double minTotalAmount = orderQueryRequest.getMinTotalAmount();
|
Double minTotalAmount = orderQueryRequest.getMinTotalAmount();
|
||||||
Double maxTotalAmount = orderQueryRequest.getMaxTotalAmount();
|
Double maxTotalAmount = orderQueryRequest.getMaxTotalAmount();
|
||||||
String orderStatus = orderQueryRequest.getOrderStatus();
|
String orderStatus = orderQueryRequest.getOrderStatus();
|
||||||
|
String orderNumber = orderQueryRequest.getOrderNumber();
|
||||||
Date startTime = orderQueryRequest.getStartTime();
|
Date startTime = orderQueryRequest.getStartTime();
|
||||||
Date endTime = orderQueryRequest.getEndTime();
|
Date endTime = orderQueryRequest.getEndTime();
|
||||||
String sortOrder = orderQueryRequest.getSortOrder();
|
String sortOrder = orderQueryRequest.getSortOrder();
|
||||||
|
@ -44,6 +44,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||||
queryWrapper.le(ObjectUtils.isNotEmpty(maxTotalAmount), "totalAmount", maxTotalAmount);
|
queryWrapper.le(ObjectUtils.isNotEmpty(maxTotalAmount), "totalAmount", maxTotalAmount);
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(orderStatus), "orderStatus", orderStatus);
|
queryWrapper.eq(StringUtils.isNotBlank(orderStatus), "orderStatus", orderStatus);
|
||||||
queryWrapper.between("createTime", startTime, endTime);
|
queryWrapper.between("createTime", startTime, endTime);
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(orderNumber), "orderNumber", orderNumber);
|
||||||
queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC),
|
queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC),
|
||||||
sortField);
|
sortField);
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user