|
@@ -1,6 +1,8 @@
|
|
|
package com.gree.mall.miniapp.logic.order;
|
|
package com.gree.mall.miniapp.logic.order;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.miniapp.bean.order.OrderDeliverBean;
|
|
import com.gree.mall.miniapp.bean.order.OrderDeliverBean;
|
|
|
import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
|
|
import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
|
|
@@ -30,17 +32,21 @@ public class OrderDeliverLogic {
|
|
|
|
|
|
|
|
public IPage<OrderInfo> orderList(String orderStatus, Integer pageNum, Integer pageSize) {
|
|
public IPage<OrderInfo> orderList(String orderStatus, Integer pageNum, Integer pageSize) {
|
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
- return orderInfoService.lambdaQuery()
|
|
|
|
|
|
|
+ LambdaQueryChainWrapper<OrderInfo> wrapper = orderInfoService.lambdaQuery()
|
|
|
.eq(OrderInfo::getDeliveryUserId, currentCompanyWechat.getUserId())
|
|
.eq(OrderInfo::getDeliveryUserId, currentCompanyWechat.getUserId())
|
|
|
- .eq(StringUtils.isNotBlank(orderStatus), OrderInfo::getOrderStatus, orderStatus)
|
|
|
|
|
- .page(new Page<>(pageNum, pageSize));
|
|
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(orderStatus), OrderInfo::getOrderStatus, orderStatus);
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotBlank(orderStatus) && !orderStatus.equals(OrderStatusEnum.OVER.toString())) {
|
|
|
|
|
+ wrapper.orderByAsc(OrderInfo::getAppointmentPickStartTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return wrapper.page(new Page<>(pageNum, pageSize));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public CountOrderStatusBean countOrderStatus() {
|
|
public CountOrderStatusBean countOrderStatus() {
|
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
- CountOrderStatusBean countOrderStatusBean3 = orderBaseCMapper.countDeliverOrder(currentCompanyWechat.getUserId());
|
|
|
|
|
|
|
|
|
|
- return countOrderStatusBean3;
|
|
|
|
|
|
|
+ return orderBaseCMapper.countDeliverOrder(currentCompanyWechat.getUserId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void finish(String orderId, String url, String finishRemark, String lng, String lat) {
|
|
public void finish(String orderId, String url, String finishRemark, String lng, String lat) {
|
|
@@ -54,6 +60,7 @@ public class OrderDeliverLogic {
|
|
|
orderInfoService.lambdaUpdate()
|
|
orderInfoService.lambdaUpdate()
|
|
|
.set(OrderInfo::getOrderStatus, OrderStatusEnum.OVER.toString())
|
|
.set(OrderInfo::getOrderStatus, OrderStatusEnum.OVER.toString())
|
|
|
.set(OrderInfo::getLastOrderStatus, OrderStatusEnum.PSZ.toString())
|
|
.set(OrderInfo::getLastOrderStatus, OrderStatusEnum.PSZ.toString())
|
|
|
|
|
+ .set(OrderInfo::getOverTime, DateUtil.date())
|
|
|
.eq(OrderInfo::getOrderId, orderId)
|
|
.eq(OrderInfo::getOrderId, orderId)
|
|
|
.eq(OrderInfo::getDeliveryUserId, currentCompanyWechat.getUserId())
|
|
.eq(OrderInfo::getDeliveryUserId, currentCompanyWechat.getUserId())
|
|
|
.update();
|
|
.update();
|