zhuyifan

feat(order): 添加同步房间号功能并优化订单查询

...@@ -131,6 +131,10 @@ public class OrderDb extends Model<OrderDb> implements Serializable { ...@@ -131,6 +131,10 @@ public class OrderDb extends Model<OrderDb> implements Serializable {
131 */ 131 */
132 private String roomNo; 132 private String roomNo;
133 /** 133 /**
134 + * 同步房间号
135 + */
136 + private String syncRoomNo;
137 + /**
134 * 点餐桌码 138 * 点餐桌码
135 */ 139 */
136 private String tableCode; 140 private String tableCode;
......
...@@ -365,10 +365,12 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu ...@@ -365,10 +365,12 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
365 if (request.getShouldFilterIsRead()) { 365 if (request.getShouldFilterIsRead()) {
366 queryWrapper.eq(OrderDb::getIsRead, request.getIsRead()); 366 queryWrapper.eq(OrderDb::getIsRead, request.getIsRead());
367 } 367 }
368 + if (request.getShouldFilterStatues()) {
369 + queryWrapper.in(OrderDb::getStatus, request.getStatuesList().stream().map(OrderStatusEnum::getNumber).collect(Collectors.toList()));
370 + }
368 queryWrapper.orderByDesc(OrderDb::getCreatedAt); 371 queryWrapper.orderByDesc(OrderDb::getCreatedAt);
369 final var list = orderDbService.list(queryWrapper); 372 final var list = orderDbService.list(queryWrapper);
370 if (!list.isEmpty()) { 373 if (!list.isEmpty()) {
371 -// builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleClientCustomerOrderRpcResponse.class));
372 builder.addAllResponses(DbToProtoUtil.orderDbListToProtoList(list)); 374 builder.addAllResponses(DbToProtoUtil.orderDbListToProtoList(list));
373 } 375 }
374 } catch (final Exception e) { 376 } catch (final Exception e) {
......
...@@ -599,6 +599,9 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl ...@@ -599,6 +599,9 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
599 if (modification.getShouldUpdateIsAllocation()) { 599 if (modification.getShouldUpdateIsAllocation()) {
600 orderDb.setIsAllocation(modification.getIsAllocation()); 600 orderDb.setIsAllocation(modification.getIsAllocation());
601 } 601 }
602 + if (modification.getShouldUpdateSyncRoomNo()) {
603 + orderDb.setSyncRoomNo(modification.getSyncRoomNo());
604 + }
602 return orderDb; 605 return orderDb;
603 }).collect(Collectors.toList()); 606 }).collect(Collectors.toList());
604 return SpringUtil.getBean(OrderDbServiceImpl.class).updateBatchById(list); 607 return SpringUtil.getBean(OrderDbServiceImpl.class).updateBatchById(list);
......
...@@ -128,6 +128,10 @@ public class DbToProtoUtil { ...@@ -128,6 +128,10 @@ public class DbToProtoUtil {
128 protoBuilder.setIsAllocation(orderDb.getIsAllocation()); 128 protoBuilder.setIsAllocation(orderDb.getIsAllocation());
129 } 129 }
130 130
131 + if (orderDb.getSyncRoomNo()!= null) {
132 + protoBuilder.setSyncRoomNo(orderDb.getSyncRoomNo());
133 + }
134 +
131 // 处理嵌套的CustomerNotice字段 135 // 处理嵌套的CustomerNotice字段
132 if (orderDb.getCustomerNoticeJson()!= null) { 136 if (orderDb.getCustomerNoticeJson()!= null) {
133 // Constructor<CustomerNotice> customerNoticeConstructor = 137 // Constructor<CustomerNotice> customerNoticeConstructor =
......
...@@ -138,6 +138,7 @@ message SingleClientCustomerOrderRpcResponse { ...@@ -138,6 +138,7 @@ message SingleClientCustomerOrderRpcResponse {
138 bool isRead = 33; 138 bool isRead = 33;
139 bool isConfirm = 34; 139 bool isConfirm = 34;
140 bool isAllocation = 35; 140 bool isAllocation = 35;
141 + string syncRoomNo = 36;
141 } 142 }
142 143
143 message GetClientCustomerOrderByIdRpcRequest { 144 message GetClientCustomerOrderByIdRpcRequest {
...@@ -243,6 +244,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest { ...@@ -243,6 +244,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest {
243 bool isConfirm = 45; 244 bool isConfirm = 45;
244 bool shouldFilterIsAllocation = 46; 245 bool shouldFilterIsAllocation = 46;
245 bool isAllocation = 47; 246 bool isAllocation = 47;
247 + bool shouldFilterStatues = 48;
248 + repeated OrderStatusEnum statues = 49;
246 } 249 }
247 250
248 message QueryClientCustomerOrdersByConditionRpcResponse { 251 message QueryClientCustomerOrdersByConditionRpcResponse {
...@@ -370,6 +373,8 @@ message ClientCustomerOrderModification { ...@@ -370,6 +373,8 @@ message ClientCustomerOrderModification {
370 bool isConfirm = 51; 373 bool isConfirm = 51;
371 bool shouldUpdateIsAllocation = 52; 374 bool shouldUpdateIsAllocation = 52;
372 bool isAllocation = 53; 375 bool isAllocation = 53;
376 + bool shouldUpdateSyncRoomNo = 54;
377 + string syncRoomNo = 55;
373 } 378 }
374 379
375 message UpdateClientCustomerOrderRpcRequest { 380 message UpdateClientCustomerOrderRpcRequest {
......