From 3a2fb3bc5dda73f04699dfdb1efd04a1beda59e6 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 27 Jun 2023 14:28:52 +0800 Subject: [PATCH] fix --- server/inventory/internal/config/config.go | 5 ++++- server/inventory/internal/logic/takelogic.go | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/inventory/internal/config/config.go b/server/inventory/internal/config/config.go index b24bb7d7..34c626d1 100644 --- a/server/inventory/internal/config/config.go +++ b/server/inventory/internal/config/config.go @@ -1,6 +1,9 @@ package config -import "github.com/zeromicro/go-zero/rest" +import ( + "fusenapi/server/inventory/internal/types" + "github.com/zeromicro/go-zero/rest" +) type Config struct { rest.RestConf diff --git a/server/inventory/internal/logic/takelogic.go b/server/inventory/internal/logic/takelogic.go index b4f9bdbe..799486e5 100644 --- a/server/inventory/internal/logic/takelogic.go +++ b/server/inventory/internal/logic/takelogic.go @@ -11,7 +11,6 @@ import ( "fusenapi/utils/auth" "fusenapi/utils/basic" "fusenapi/utils/snow_id_generator" - "github.com/bwmarrin/snowflake" "gorm.io/gorm" "time" @@ -88,7 +87,7 @@ func (l *TakeLogic) Take(req *types.TakeReq, userinfo *auth.UserInfo) (resp *bas return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, fmt.Sprintf("row %d inventory data`s take num can`be less than 0", k+1)) } //获取库存信息(枷锁) - stockInfo, err := l.svcCtx.AllModels.FsUserStock.FindOne(l.ctx, v.Id, userinfo.UserId, true) + stockInfo, err := l.svcCtx.AllModels.FsUserStock.FindOne(l.ctx, formItem.Id, userinfo.UserId, true) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, fmt.Sprintf("row %d inventory data is not availabled for you", k+1))