feat(商城): 添加订单详情

master
wayn 3 years ago
parent ebc617174e
commit 23d6c5c76f

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.7</version> <version>2.5.8</version>
</parent> </parent>
<modules> <modules>
<module>waynboot-common</module> <module>waynboot-common</module>

@ -40,6 +40,7 @@ public class OrderDetailVO implements Serializable {
* *
*/ */
private Short orderStatus; private Short orderStatus;
private String orderStatusText;
/** /**
* 0123退45 * 0123退45
@ -110,6 +111,7 @@ public class OrderDetailVO implements Serializable {
* 1 2 * 1 2
*/ */
private Integer payType; private Integer payType;
private String payTypeText;
/** /**
* *

@ -79,6 +79,19 @@ public class OrderUtil {
throw new IllegalStateException("orderStatus不支持"); throw new IllegalStateException("orderStatus不支持");
} }
public static String payTypeText(Order order) {
Integer payType = order.getPayType();
if (payType == 1) {
return "微信";
} else if (payType == 2) {
return "支付宝";
} else if (payType == 3) {
return "TEST";
}
throw new IllegalStateException("payType不支持");
}
public static OrderHandleOption build(Order order) { public static OrderHandleOption build(Order order) {
int status = order.getOrderStatus().intValue(); int status = order.getOrderStatus().intValue();
@ -151,9 +164,7 @@ public class OrderUtil {
} }
public static boolean hasPayed(Order order) { public static boolean hasPayed(Order order) {
return OrderUtil.STATUS_CREATE != order.getOrderStatus().shortValue() return OrderUtil.STATUS_CREATE != order.getOrderStatus().shortValue() && OrderUtil.STATUS_CANCEL != order.getOrderStatus().shortValue() && OrderUtil.STATUS_AUTO_CANCEL != order.getOrderStatus().shortValue();
&& OrderUtil.STATUS_CANCEL != order.getOrderStatus().shortValue()
&& OrderUtil.STATUS_AUTO_CANCEL != order.getOrderStatus().shortValue();
} }
public static boolean isPayStatus(Order order) { public static boolean isPayStatus(Order order) {

@ -1,8 +1,5 @@
package com.wayn.common.enums; package com.wayn.common.enums;
import java.util.Arrays;
import java.util.stream.Collectors;
/** /**
* *
*/ */

@ -175,6 +175,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
Order order = getOne(queryWrapper); Order order = getOne(queryWrapper);
OrderDetailVO orderDetailVO = new OrderDetailVO(); OrderDetailVO orderDetailVO = new OrderDetailVO();
MyBeanUtil.copyProperties(order, orderDetailVO); MyBeanUtil.copyProperties(order, orderDetailVO);
orderDetailVO.setOrderStatusText(OrderUtil.orderStatusText(order));
orderDetailVO.setPayTypeText(OrderUtil.payTypeText(order));
LambdaQueryWrapper<OrderGoods> queryWrapper1 = Wrappers.lambdaQuery(OrderGoods.class); LambdaQueryWrapper<OrderGoods> queryWrapper1 = Wrappers.lambdaQuery(OrderGoods.class);
queryWrapper1.eq(OrderGoods::getOrderId, order.getId()); queryWrapper1.eq(OrderGoods::getOrderId, order.getId());
List<OrderGoods> list = iOrderGoodsService.list(queryWrapper1); List<OrderGoods> list = iOrderGoodsService.list(queryWrapper1);

Loading…
Cancel
Save