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
wangyingyang
2025-03-13 14:22:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
08f9d57e24da4d7a20891d1d55512ba71ec2e09e
08f9d57e
1 parent
050017d0
add order cancel
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
7 deletions
sql/table.sql
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
sql/table.sql
View file @
08f9d57
...
...
@@ -51,7 +51,8 @@ ALTER TABLE `client_customer_orders`
ADD
COLUMN
`closeTimeType`
tinyint
(
4
)
NOT
NULL
COMMENT
'餐单截单类型;0:立即,1:预定'
AFTER
`menuId`
,
ADD
COLUMN
`isRead`
tinyint
(
1
)
NOT
NULL
DEFAULT
0
COMMENT
'是否已读;0:未读,1:已读'
AFTER
`isDeleted`
,
ADD
COLUMN
`isConfirm`
TINYINT
(
1
)
NOT
NULL
DEFAULT
0
COMMENT
'是否确认;0:未确认,1:已确认'
AFTER
`isRead`
,
ADD
COLUMN
`isAllocation`
tinyint
(
1
)
NOT
NULL
DEFAULT
0
COMMENT
'是否调拨;0:未调拨,1:已调拨'
AFTER
`isConfirm`
;
ADD
COLUMN
`isAllocation`
tinyint
(
1
)
NOT
NULL
DEFAULT
0
COMMENT
'是否调拨;0:未调拨,1:已调拨'
AFTER
`isConfirm`
,
ADD
COLUMN
`isCanceled`
tinyint
(
1
)
NOT
NULL
DEFAULT
0
COMMENT
'是否撤销;0:未撤销,1:已撤销'
AFTER
`isAllocation`
;
CREATE
TABLE
`client_customer_order_details`
(
`id`
INT
AUTO_INCREMENT
PRIMARY
KEY
COMMENT
'订单详情表主键,自增整数'
,
...
...
src/main/java/com/tianting/infoloop/model/db/OrderDb.java
View file @
08f9d57
...
...
@@ -177,4 +177,8 @@ public class OrderDb extends Model<OrderDb> implements Serializable {
* 是否调拨至厨房
*/
private
Boolean
isAllocation
;
/**
* 是否撤销订单
*/
private
Boolean
isCanceled
;
}
\ No newline at end of file
...
...
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
View file @
08f9d57
...
...
@@ -368,6 +368,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
if
(
request
.
getShouldFilterStatues
())
{
queryWrapper
.
in
(
OrderDb:
:
getStatus
,
request
.
getStatuesList
().
stream
().
map
(
OrderStatusEnum:
:
getNumber
).
collect
(
Collectors
.
toList
()));
}
if
(
request
.
getShouldFilterIsCanceled
())
{
queryWrapper
.
eq
(
OrderDb:
:
getIsCanceled
,
request
.
getIsCanceled
());
}
queryWrapper
.
orderByDesc
(
OrderDb:
:
getCreatedAt
);
final
var
list
=
orderDbService
.
list
(
queryWrapper
);
if
(!
list
.
isEmpty
())
{
...
...
src/main/java/com/tianting/infoloop/service/impl/OrderDbServiceImpl.java
View file @
08f9d57
...
...
@@ -119,6 +119,7 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
orderDb
.
setIsDeleted
(
false
);
orderDb
.
setIsConfirm
(
false
);
orderDb
.
setIsAllocation
(
false
);
orderDb
.
setIsCanceled
(
false
);
boolean
res
=
this
.
save
(
orderDb
);
if
(!
res
)
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_GEN_FAIL
);
...
...
@@ -337,6 +338,7 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
orderDb
.
setIsDeleted
(
false
);
orderDb
.
setIsConfirm
(
false
);
orderDb
.
setIsAllocation
(
false
);
orderDb
.
setIsCanceled
(
false
);
boolean
res
=
this
.
save
(
orderDb
);
if
(!
res
)
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_GEN_FAIL
);
...
...
@@ -501,6 +503,9 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
if
(
updateOrderRequest
.
getModification
().
getShouldUpdateIsAllocation
())
{
orderDb
.
setIsAllocation
(
updateOrderRequest
.
getModification
().
getIsAllocation
());
}
if
(
updateOrderRequest
.
getModification
().
getShouldUpdateIsCanceled
())
{
orderDb
.
setIsCanceled
(
updateOrderRequest
.
getModification
().
getIsCanceled
());
}
return
orderDbMapper
.
updateById
(
orderDb
)
>
0
;
}
...
...
@@ -602,6 +607,9 @@ public class OrderDbServiceImpl extends ServiceImpl<OrderDbMapper, OrderDb> impl
if
(
modification
.
getShouldUpdateSyncRoomNo
())
{
orderDb
.
setSyncRoomNo
(
modification
.
getSyncRoomNo
());
}
if
(
modification
.
getShouldUpdateIsCanceled
())
{
orderDb
.
setIsCanceled
(
modification
.
getIsCanceled
());
}
return
orderDb
;
}).
collect
(
Collectors
.
toList
());
return
SpringUtil
.
getBean
(
OrderDbServiceImpl
.
class
).
updateBatchById
(
list
);
...
...
src/main/java/com/tianting/infoloop/utils/DbToProtoUtil.java
View file @
08f9d57
...
...
@@ -128,6 +128,10 @@ public class DbToProtoUtil {
protoBuilder
.
setIsAllocation
(
orderDb
.
getIsAllocation
());
}
if
(
orderDb
.
getIsCanceled
()!=
null
)
{
protoBuilder
.
setIsCanceled
(
orderDb
.
getIsCanceled
());
}
if
(
orderDb
.
getSyncRoomNo
()!=
null
)
{
protoBuilder
.
setSyncRoomNo
(
orderDb
.
getSyncRoomNo
());
}
...
...
src/main/proto/ClientCustomerOrderService.proto
View file @
08f9d57
...
...
@@ -139,6 +139,7 @@ message SingleClientCustomerOrderRpcResponse {
bool
isConfirm
=
34
;
bool
isAllocation
=
35
;
string
syncRoomNo
=
36
;
bool
isCanceled
=
37
;
}
message
GetClientCustomerOrderByIdRpcRequest
{
...
...
@@ -173,12 +174,15 @@ message GetClientCustomerOrdersByCustomerIdRpcResponse {
message
QueryClientCustomerOrdersByPaginationRpcRequest
{
string
keyword
=
1
;
OrderStatusEnum
status
=
2
;
int32
clientId
=
3
;
int32
enterpriseId
=
4
;
int32
pageNo
=
5
;
int32
pageSize
=
6
;
repeated
int32
stallIds
=
7
;
bool
shouldFilterStatus
=
2
;
OrderStatusEnum
status
=
3
;
int32
clientId
=
4
;
int32
enterpriseId
=
5
;
int32
pageNo
=
6
;
int32
pageSize
=
7
;
repeated
int32
stallIds
=
8
;
bool
shouldFilterIsCanceled
=
9
;
bool
isCanceled
=
10
;
}
message
OrderCountByStatus
{
...
...
@@ -246,6 +250,8 @@ message QueryClientCustomerOrdersByConditionRpcRequest {
bool
isAllocation
=
47
;
bool
shouldFilterStatues
=
48
;
repeated
OrderStatusEnum
statues
=
49
;
bool
shouldFilterIsCanceled
=
50
;
bool
isCanceled
=
51
;
}
message
QueryClientCustomerOrdersByConditionRpcResponse
{
...
...
@@ -375,6 +381,8 @@ message ClientCustomerOrderModification {
bool
isAllocation
=
53
;
bool
shouldUpdateSyncRoomNo
=
54
;
string
syncRoomNo
=
55
;
bool
shouldUpdateIsCanceled
=
56
;
bool
isCanceled
=
57
;
}
message
UpdateClientCustomerOrderRpcRequest
{
...
...
Please
register
or
login
to post a comment