zhuyifan

feat(order): 添加订单用餐时间查询功能

- 在OrderDbDTO中新增mealTime字段用于存储用餐时间- 在OrderServiceRpcClient中引入日期处理工具类
- 实现根据用餐时间范围过滤订单的查询逻辑
-优化代码格式并保持方法参数对齐
......@@ -71,6 +71,7 @@ public class OrderDbDTO {
private OrderStatusEnum status;
private String keyword;
private List<Integer> stallIds;
private String mealTime;
}
@Data
......
package com.infoloop.tianting.service.client;
import cn.hutool.core.date.DateTime;
import com.infoloop.tianting.SingleResponse;
import com.infoloop.tianting.SingleSkuResponse;
import com.infoloop.tianting.SingleSpecialResponse;
......@@ -494,9 +495,14 @@ public class OrderServiceRpcClient {
.setStatus(queryOrderDto.getStatus())
.setEnterpriseId(queryOrderDto.getEnterpriseId())
.setShouldFilterClientIds(true).addClientIds(queryOrderDto.getClientId())
.setShouldFilterStallIds(true).addAllStallIds(queryOrderDto.getStallIds())
.build();
return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request);
.setShouldFilterStallIds(true).addAllStallIds(queryOrderDto.getStallIds());
if (StringUtils.isNotEmpty(queryOrderDto.getMealTime())) {
DateTime date = cn.hutool.core.date.DateUtil.parse(queryOrderDto.getMealTime());
long startOfDay = cn.hutool.core.date.DateUtil.beginOfDay(date).getTime();
long endOfDay = cn.hutool.core.date.DateUtil.endOfDay(date).getTime();
request.setShouldFilterMealTimeStart(true).setMealTimeStart(startOfDay).setShouldFilterMealTimeEnd(true).setMealTimeEnd(endOfDay);
}
return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request.build());
}
public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination(
......