Showing
2 changed files
with
11 additions
and
0 deletions
| ... | @@ -251,12 +251,22 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu | ... | @@ -251,12 +251,22 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu |
| 251 | canceledCount += (int) count; | 251 | canceledCount += (int) count; |
| 252 | } | 252 | } |
| 253 | } | 253 | } |
| 254 | + LambdaQueryWrapper<OrderDb> queryRefundCountWrapper = Wrappers.lambdaQuery(); | ||
| 255 | + if (!request.getKeyword().isEmpty()) { | ||
| 256 | + queryRefundCountWrapper.like(OrderDb::getMealTime, request.getKeyword()); | ||
| 257 | + } | ||
| 258 | + queryRefundCountWrapper.eq(OrderDb::getEnterpriseId, request.getEnterpriseId()); | ||
| 259 | + queryRefundCountWrapper.eq(OrderDb::getClientId, request.getClientId()); | ||
| 260 | + queryRefundCountWrapper.in(OrderDb::getStallId, request.getStallIdsList()); | ||
| 261 | + queryRefundCountWrapper.in(OrderDb::getPayStatus, List.of(PayStatusEnum.REFUND_VALUE)); | ||
| 262 | + final var refundCount = orderDbService.count(queryRefundCountWrapper); | ||
| 254 | builder.setCountByStatus(OrderCountByStatus.newBuilder() | 263 | builder.setCountByStatus(OrderCountByStatus.newBuilder() |
| 255 | .setUnknownCount(unknownCount) | 264 | .setUnknownCount(unknownCount) |
| 256 | .setToPrepareCount(toPrepareCount) | 265 | .setToPrepareCount(toPrepareCount) |
| 257 | .setPreparingCount(preparingCount) | 266 | .setPreparingCount(preparingCount) |
| 258 | .setAllServedCount(allServedCount) | 267 | .setAllServedCount(allServedCount) |
| 259 | .setCanceledCount(canceledCount) | 268 | .setCanceledCount(canceledCount) |
| 269 | + .setRefundCount((int)refundCount) | ||
| 260 | .build()); | 270 | .build()); |
| 261 | builder.setTotal(result.getTotal()); | 271 | builder.setTotal(result.getTotal()); |
| 262 | builder.setPages(result.getPages()); | 272 | builder.setPages(result.getPages()); | ... | ... |
| ... | @@ -192,6 +192,7 @@ message OrderCountByStatus { | ... | @@ -192,6 +192,7 @@ message OrderCountByStatus { |
| 192 | int32 preparingCount = 3; | 192 | int32 preparingCount = 3; |
| 193 | int32 allServedCount = 4; | 193 | int32 allServedCount = 4; |
| 194 | int32 canceledCount = 5; | 194 | int32 canceledCount = 5; |
| 195 | + int32 refundCount = 6; | ||
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | message QueryClientCustomerOrdersByPaginationRpcResponse { | 198 | message QueryClientCustomerOrdersByPaginationRpcResponse { | ... | ... |
-
Please register or login to post a comment