zhuyifan

院区端订单只查今天和以后的

......@@ -83,6 +83,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
......@@ -219,6 +220,8 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
} else {
queryWrapper.in(OrderDb::getPayStatus, List.of(PayStatusEnum.SUCCEED_VALUE, PayStatusEnum.PAY_CANCELED_VALUE));
}
// 只查询今天和以后的订单
queryWrapper.ge(OrderDb::getMealTime, LocalDate.now().atStartOfDay());
queryWrapper.orderByDesc(OrderDb::getCreatedAt);
final var result = orderDbService.page(page, queryWrapper);
......@@ -238,6 +241,8 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
queryCountWrapper.eq(OrderDb::getStatus, status.ordinal());
queryCountWrapper.in(OrderDb::getStallId, request.getStallIdsList());
queryCountWrapper.in(OrderDb::getPayStatus, List.of(PayStatusEnum.SUCCEED_VALUE, PayStatusEnum.PAY_CANCELED_VALUE));
// 只查询今天和以后的订单
queryCountWrapper.ge(OrderDb::getMealTime, LocalDate.now().atStartOfDay());
final var count = orderDbService.count(queryCountWrapper);
if (status.equals(OrderStatusEnum.UNKNOWN_STATUS)) {
unknownCount += (int) count;
......@@ -259,6 +264,8 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
queryRefundCountWrapper.eq(OrderDb::getClientId, request.getClientId());
queryRefundCountWrapper.in(OrderDb::getStallId, request.getStallIdsList());
queryRefundCountWrapper.in(OrderDb::getPayStatus, List.of(PayStatusEnum.REFUND_VALUE));
// 只查询今天和以后的订单
queryRefundCountWrapper.ge(OrderDb::getMealTime, LocalDate.now().atStartOfDay());
final var refundCount = orderDbService.count(queryRefundCountWrapper);
builder.setCountByStatus(OrderCountByStatus.newBuilder()
.setUnknownCount(unknownCount)
......