|
@@ -0,0 +1,43 @@
|
|
|
|
|
+package com.gree.mall.miniapp.logic.order;
|
|
|
|
|
+
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.gree.mall.miniapp.bean.order.OrderDeliverBean;
|
|
|
|
|
+import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
|
|
|
|
|
+import com.gree.mall.miniapp.bean.workorder.CountOrderStatusBean;
|
|
|
|
|
+import com.gree.mall.miniapp.commonmapper.CommonMapper;
|
|
|
|
|
+import com.gree.mall.miniapp.commonmapper.workorder.OrderBaseCMapper;
|
|
|
|
|
+import com.gree.mall.miniapp.logic.common.CommonLogic;
|
|
|
|
|
+import com.gree.mall.miniapp.plus.entity.OrderInfo;
|
|
|
|
|
+import com.gree.mall.miniapp.plus.service.OrderInfoService;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
+
|
|
|
|
|
+@Service
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
|
|
+public class OrderDeliverLogic {
|
|
|
|
|
+
|
|
|
|
|
+ private final CommonLogic commonLogic;
|
|
|
|
|
+ private final OrderInfoService orderInfoService;
|
|
|
|
|
+ private final OrderBaseCMapper orderBaseCMapper;
|
|
|
|
|
+
|
|
|
|
|
+ public IPage<OrderInfo> orderList(String orderStatus, Integer pageNum, Integer pageSize) {
|
|
|
|
|
+ CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
|
|
+ return orderInfoService.lambdaQuery()
|
|
|
|
|
+ .eq(OrderInfo::getDeliveryUserId, currentCompanyWechat.getUserId())
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(orderStatus), OrderInfo::getOrderStatus, orderStatus)
|
|
|
|
|
+ .page(new Page<>(pageNum, pageSize));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public CountOrderStatusBean countOrderStatus() {
|
|
|
|
|
+ CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
|
|
+ CountOrderStatusBean countOrderStatusBean3 = orderBaseCMapper.countDeliverOrder(currentCompanyWechat.getUserId());
|
|
|
|
|
+
|
|
|
|
|
+ return countOrderStatusBean3;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|