我的订单点击跳转订单详情页;订单详情页展示订单总金额;立即下单可以选择商品数量
This commit is contained in:
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@@ -14,4 +15,6 @@ public class Order {
|
||||
private Integer userId;
|
||||
private LocalDateTime orderDate;
|
||||
private String orderStatus;
|
||||
private BigDecimal orderPrice;
|
||||
private LocalDateTime payDate;
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import lombok.experimental.Accessors;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -23,6 +24,9 @@ public class OrderVO implements Serializable {
|
||||
private Integer userId;
|
||||
private LocalDateTime orderDate;
|
||||
private String orderStatus;
|
||||
private String orderStatusCode;
|
||||
private String orderPrice;
|
||||
private LocalDateTime payDate;
|
||||
|
||||
public static OrderVO convertFrom(Order order) {
|
||||
if (order == null) {
|
||||
@@ -34,6 +38,9 @@ public class OrderVO implements Serializable {
|
||||
orderVO.setId(String.valueOf(order.getId())); // 转成字符串 避免前端丢失精度
|
||||
OrderStatus orderStatus = OrderStatus.get(order.getOrderStatus());
|
||||
orderVO.setOrderStatus(orderStatus.toString());
|
||||
orderVO.setOrderStatusCode(order.getOrderStatus());
|
||||
String price = order.getOrderPrice().setScale(2, RoundingMode.FLOOR).toPlainString();
|
||||
orderVO.setOrderPrice(price);
|
||||
return orderVO;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user