From 799c4604b1a362ada31ba4711b21f695b70870d9 Mon Sep 17 00:00:00 2001 From: js199000131 <2728757160@qq.com> Date: Thu, 11 May 2023 16:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=B5=81=E7=AE=A1=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/shop/utils/OrderUtils.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtils.java diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtils.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtils.java new file mode 100644 index 000000000..7de545caf --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtils.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.shop.utils; + + +import cn.iocoder.yudao.framework.common.enums.Constants; +import cn.iocoder.yudao.framework.common.exception.ServiceException; +import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.springframework.stereotype.Service; + +@Service +public class OrderUtils { + + /** + * h5 订单查询 where status 封装 + * @param queryWrapper 查询条件 + * @param status 状态 + */ + public void statusApiByWhere(LambdaQueryWrapper queryWrapper, Integer status){ + switch (status){ + case Constants.ORDER_STATUS_H5_UNPAID: // 未支付 + queryWrapper.eq(StoreOrder::getPaid, false); + queryWrapper.eq(StoreOrder::getStatus, 0); + queryWrapper.eq(StoreOrder::getRefundStatus, 0); + queryWrapper.eq(StoreOrder::getType, 0); + break; + case Constants.ORDER_STATUS_H5_NOT_SHIPPED: // 待发货 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.eq(StoreOrder::getStatus, 0); + queryWrapper.eq(StoreOrder::getRefundStatus, 0); +// queryWrapper.eq(StoreOrder::getShippingType, 1); + break; + case Constants.ORDER_STATUS_H5_SPIKE: // 待收货 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.eq(StoreOrder::getStatus, 1); + queryWrapper.eq(StoreOrder::getRefundStatus, 0); + break; + case Constants.ORDER_STATUS_H5_JUDGE: // 已支付 已收货 待评价 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.eq(StoreOrder::getStatus, 2); + queryWrapper.eq(StoreOrder::getRefundStatus, 0); + break; + case Constants.ORDER_STATUS_H5_COMPLETE: // 已完成 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.eq(StoreOrder::getStatus, 3); + queryWrapper.eq(StoreOrder::getRefundStatus, 0); + break; + case Constants.ORDER_STATUS_H5_REFUNDING: // 退款中 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.in(StoreOrder::getRefundStatus, 1, 3); + break; + case Constants.ORDER_STATUS_H5_REFUNDED: // 已退款 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.eq(StoreOrder::getRefundStatus, 2); + break; + case Constants.ORDER_STATUS_H5_REFUND: // 包含已退款和退款中 + queryWrapper.eq(StoreOrder::getPaid, true); + queryWrapper.in(StoreOrder::getRefundStatus, 1,2,3); + break; + } + queryWrapper.eq(StoreOrder::getIsDel, false); + queryWrapper.eq(StoreOrder::getIsSystemDel, false); + } + + + +}