Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-03-07 15:38:00 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
050017d04dede4811d2e08c356b06708d203bc01
050017d0
1 parent
b128cd47
feat(order): 添加同步房间号功能并优化订单查询
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletions
src/main/java/com/tianting/infoloop/model/db/OrderDb.java
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
src/main/java/com/tianting/infoloop/service/impl/OrderDbServiceImpl.java
src/main/java/com/tianting/infoloop/utils/DbToProtoUtil.java
src/main/proto/ClientCustomerOrderService.proto
src/main/java/com/tianting/infoloop/model/db/OrderDb.java
View file @
050017d
...
...
@@ -131,6 +131,10 @@ public class OrderDb extends Model<OrderDb> implements Serializable {
*/
private
String
roomNo
;
/**
* 同步房间号
*/
private
String
syncRoomNo
;
/**
* 点餐桌码
*/
private
String
tableCode
;
...
...
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
View file @
050017d
...
...
@@ -365,10 +365,12 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
if
(
request
.
getShouldFilterIsRead
())
{
queryWrapper
.
eq
(
OrderDb:
:
getIsRead
,
request
.
getIsRead
());
}
if
(
request
.
getShouldFilterStatues
())
{
queryWrapper
.
in
(
OrderDb:
:
getStatus
,
request
.
getStatuesList
().
stream
().
map
(
OrderStatusEnum:
:
getNumber
).
collect
(
Collectors
.
toList
()));
}
queryWrapper
.
orderByDesc
(
OrderDb:
:
getCreatedAt
);
final
var
list
=
orderDbService
.
list
(
queryWrapper
);
if
(!
list
.
isEmpty
())
{
// builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleClientCustomerOrderRpcResponse.class));
builder
.
addAllResponses
(
DbToProtoUtil
.
orderDbListToProtoList
(
list
));
}
}
catch
(
final
Exception
e
)
{
...
...
src/main/java/com/tianting/infoloop/service/impl/OrderDbServiceImpl.java
View file @
050017d
...
...
@@ -599,6 +599,9 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
if
(
modification
.
getShouldUpdateIsAllocation
())
{
orderDb
.
setIsAllocation
(
modification
.
getIsAllocation
());
}
if
(
modification
.
getShouldUpdateSyncRoomNo
())
{
orderDb
.
setSyncRoomNo
(
modification
.
getSyncRoomNo
());
}
return
orderDb
;
}).
collect
(
Collectors
.
toList
());
return
SpringUtil
.
getBean
(
OrderDbServiceImpl
.
class
).
updateBatchById
(
list
);
...
...
src/main/java/com/tianting/infoloop/utils/DbToProtoUtil.java
View file @
050017d
...
...
@@ -128,6 +128,10 @@ public class DbToProtoUtil {
protoBuilder
.
setIsAllocation
(
orderDb
.
getIsAllocation
());
}
if
(
orderDb
.
getSyncRoomNo
()!=
null
)
{
protoBuilder
.
setSyncRoomNo
(
orderDb
.
getSyncRoomNo
());
}
// 处理嵌套的CustomerNotice字段
if
(
orderDb
.
getCustomerNoticeJson
()!=
null
)
{
// Constructor<CustomerNotice> customerNoticeConstructor =
...
...
src/main/proto/ClientCustomerOrderService.proto
View file @
050017d
...
...
@@ -138,6 +138,7 @@ message SingleClientCustomerOrderRpcResponse {
bool
isRead
=
33
;
bool
isConfirm
=
34
;
bool
isAllocation
=
35
;
string
syncRoomNo
=
36
;
}
message
GetClientCustomerOrderByIdRpcRequest
{
...
...
@@ -243,6 +244,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest {
bool
isConfirm
=
45
;
bool
shouldFilterIsAllocation
=
46
;
bool
isAllocation
=
47
;
bool
shouldFilterStatues
=
48
;
repeated
OrderStatusEnum
statues
=
49
;
}
message
QueryClientCustomerOrdersByConditionRpcResponse
{
...
...
@@ -370,6 +373,8 @@ message ClientCustomerOrderModification {
bool
isConfirm
=
51
;
bool
shouldUpdateIsAllocation
=
52
;
bool
isAllocation
=
53
;
bool
shouldUpdateSyncRoomNo
=
54
;
string
syncRoomNo
=
55
;
}
message
UpdateClientCustomerOrderRpcRequest
{
...
...
Please
register
or
login
to post a comment