物流管理修改
parent
5342d330ef
commit
799c4604b1
|
@ -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<StoreOrder> 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue