feat: sale manager

This commit is contained in:
zzw
2026-08-28 10:49:09 +08:00
parent 97eba7ad48
commit 6f567319be
82 changed files with 4491 additions and 182 deletions
+10
View File
@@ -31,6 +31,8 @@ type (
NameItem = product.NameItem
NamesReq = product.NamesReq
NumberAddReq = product.NumberAddReq
NumberItem = product.NumberItem
NumberItemsReq = product.NumberItemsReq
NumberReq = product.NumberReq
Response = product.Response
SortReq = product.SortReq
@@ -64,6 +66,8 @@ type (
EditApplyPass(ctx context.Context, in *EditApplyPassReq, opts ...grpc.CallOption) (*Response, error)
// 增减库存
Number(ctx context.Context, in *NumberReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 批量增减库存(服务内按 id 排序后在同一事务中执行,防死锁)
NumberItems(ctx context.Context, in *NumberItemsReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
InfoById(ctx context.Context, in *InfoByIdReq, opts ...grpc.CallOption) (*Item, error)
ItemsByIds(ctx context.Context, in *ItemsByIdsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error)
// 增加库存
@@ -159,6 +163,12 @@ func (m *defaultProduct) Number(ctx context.Context, in *NumberReq, opts ...grpc
return client.Number(ctx, in, opts...)
}
// 批量增减库存(服务内按 id 排序后在同一事务中执行,防死锁)
func (m *defaultProduct) NumberItems(ctx context.Context, in *NumberItemsReq, opts ...grpc.CallOption) (*emptypb.Empty, error) {
client := product.NewProductClient(m.cli.Conn())
return client.NumberItems(ctx, in, opts...)
}
func (m *defaultProduct) InfoById(ctx context.Context, in *InfoByIdReq, opts ...grpc.CallOption) (*Item, error) {
client := product.NewProductClient(m.cli.Conn())
return client.InfoById(ctx, in, opts...)