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-04 10:03:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1f63ca486b2a76db4a5f70c5ee08aef8530b1c0a
1f63ca48
1 parent
37faa9d5
释放库存
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
src/main/proto/ClientCustomerOrderService.proto
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
View file @
1f63ca4
...
...
@@ -4,6 +4,7 @@ package com.tianting.infoloop.service.grpc;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -56,6 +57,8 @@ import com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesBy
import
com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse
;
import
com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesByStallRpcRequest
;
import
com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesByStallRpcResponse
;
import
com.infoloop.tianting.clientcustomerorderservice.ReleaseSkusSellQuantitiesRpcRequest
;
import
com.infoloop.tianting.clientcustomerorderservice.ReleaseSkusSellQuantitiesRpcResponse
;
import
com.infoloop.tianting.clientcustomerorderservice.SingleSkuSellQuantityRpcResponse
;
import
com.infoloop.tianting.clientcustomerorderservice.SkuSellQuantityModification
;
import
com.infoloop.tianting.clientcustomerorderservice.UpdateClientCustomerOrderDetailRpcRequest
;
...
...
@@ -785,4 +788,23 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
responseStreamObserver
.
onCompleted
();
}
@Override
@DS
(
DATA_SOURCE_MASTER
)
public
void
releaseSkusSellQuantities
(
final
ReleaseSkusSellQuantitiesRpcRequest
request
,
final
StreamObserver
<
ReleaseSkusSellQuantitiesRpcResponse
>
responseStreamObserver
)
{
final
var
builder
=
ReleaseSkusSellQuantitiesRpcResponse
.
newBuilder
();
try
{
LambdaUpdateWrapper
<
SkuSellQuantity
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
SkuSellQuantity:
:
getEnterpriseId
,
request
.
getEnterpriseId
());
updateWrapper
.
set
(
SkuSellQuantity:
:
getTodaySellQuantity
,
0
);
builder
.
setIsReleased
(
skuSellQuantityService
.
update
(
updateWrapper
));
}
catch
(
final
Exception
e
)
{
log
.
error
(
"releaseSkusSellQuantities error;"
,
e
);
responseStreamObserver
.
onError
(
Status
.
INTERNAL
.
withDescription
(
e
.
getMessage
()).
asException
());
return
;
}
responseStreamObserver
.
onNext
(
builder
.
build
());
responseStreamObserver
.
onCompleted
();
}
}
...
...
src/main/proto/ClientCustomerOrderService.proto
View file @
1f63ca4
...
...
@@ -40,6 +40,7 @@ service ClientCustomerOrderServiceRpc {
rpc
QuerySkuSellQuantitiesByStallAndSkuIds
(
QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest
)
returns
(
QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse
)
{}
rpc
BatchSaveSkuSellQuantities
(
BatchSaveSkuSellQuantitiesRpcRequest
)
returns
(
BatchSaveSkuSellQuantitiesRpcResponse
)
{}
rpc
AddSkusSellQuantities
(
AddSkusSellQuantitiesRpcRequest
)
returns
(
AddSkusSellQuantitiesRpcResponse
)
{}
rpc
ReleaseSkusSellQuantities
(
ReleaseSkusSellQuantitiesRpcRequest
)
returns
(
ReleaseSkusSellQuantitiesRpcResponse
)
{}
}
...
...
@@ -684,3 +685,11 @@ message SkuSellQuantity {
message
AddSkusSellQuantitiesRpcResponse
{
bool
isAdded
=
1
;
}
message
ReleaseSkusSellQuantitiesRpcRequest
{
int32
enterpriseId
=
1
;
}
message
ReleaseSkusSellQuantitiesRpcResponse
{
bool
isReleased
=
1
;
}
...
...
Please
register
or
login
to post a comment