wangyingyang

add refund count

......@@ -251,12 +251,22 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
canceledCount += (int) count;
}
}
LambdaQueryWrapper<OrderDb> queryRefundCountWrapper = Wrappers.lambdaQuery();
if (!request.getKeyword().isEmpty()) {
queryRefundCountWrapper.like(OrderDb::getMealTime, request.getKeyword());
}
queryRefundCountWrapper.eq(OrderDb::getEnterpriseId, request.getEnterpriseId());
queryRefundCountWrapper.eq(OrderDb::getClientId, request.getClientId());
queryRefundCountWrapper.in(OrderDb::getStallId, request.getStallIdsList());
queryRefundCountWrapper.in(OrderDb::getPayStatus, List.of(PayStatusEnum.REFUND_VALUE));
final var refundCount = orderDbService.count(queryRefundCountWrapper);
builder.setCountByStatus(OrderCountByStatus.newBuilder()
.setUnknownCount(unknownCount)
.setToPrepareCount(toPrepareCount)
.setPreparingCount(preparingCount)
.setAllServedCount(allServedCount)
.setCanceledCount(canceledCount)
.setRefundCount((int)refundCount)
.build());
builder.setTotal(result.getTotal());
builder.setPages(result.getPages());
......
......@@ -192,6 +192,7 @@ message OrderCountByStatus {
int32 preparingCount = 3;
int32 allServedCount = 4;
int32 canceledCount = 5;
int32 refundCount = 6;
}
message QueryClientCustomerOrdersByPaginationRpcResponse {
......