From 5f6e175e8667cc3e1c1389c78799dfa989dda123 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4672LME\\Xu Tengfei" Date: Wed, 4 Aug 2021 14:01:30 +0800 Subject: [PATCH] =?UTF-8?q?wms=20=E7=9B=98=E7=82=B9bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryCheckHead.service.impl.go | 19 ++++++++++--------- web/controllers/wm/InventoryCheckHead.rest.go | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/services/wm/implments/InventoryCheckHead.service.impl.go b/services/wm/implments/InventoryCheckHead.service.impl.go index ef41f68..f753a5a 100644 --- a/services/wm/implments/InventoryCheckHead.service.impl.go +++ b/services/wm/implments/InventoryCheckHead.service.impl.go @@ -628,22 +628,22 @@ func (impl *InventoryCheckHeadServiceImplement) AccomplishCheckHead(user *models lst.CheckResult = model.CHECK_RESULT_LESS } if lst.ActQty != book.Qty { - articleWithReplenish, err := artDao.SelectOneWithReplenish(lst.ArtId) + article, err := artDao.SelectOne(lst.ArtId) if err != nil { _ = session.Rollback() return err } - if articleWithReplenish == nil { + if article == nil { _ = session.Rollback() return grmi.NewBusinessError("不存在对应的物料") } - articleWithReplenish.Article.Qty = articleWithReplenish.Article.Qty + (lst.ActQty - book.Qty) - err = artDao.UpdateOne(&articleWithReplenish.Article) + article.Qty = article.Qty + (lst.ActQty - book.Qty) + err = artDao.UpdateOne(article) if err != nil { _ = session.Rollback() return err } - if articleWithReplenish.Article.Qty < articleWithReplenish.ArticleReplenish.MinQty { + if article.Qty < article.ArticleReplenish.MinQty { orderLi, err := replenishDao.Select([]grmi.Predicate{meta.ReplenishOrder_ArtId.NewPredicate(grmi.Equal, lst.ArtId), meta.ReplenishOrder_Status.NewPredicate(grmi.Equal, model.REPLENISH_ORDER_STATUS_ON)}, nil) if err != nil { _ = session.Rollback() @@ -660,11 +660,11 @@ func (impl *InventoryCheckHeadServiceImplement) AccomplishCheckHead(user *models replenishOrder := model.ReplenishOrder{ ReplenishId: orderId, ArtId: lst.ArtId, - Qty: articleWithReplenish.ArticleReplenish.ReplenishQty, - Uom: articleWithReplenish.Article.Uom, + Qty: article.ArticleReplenish.ReplenishQty, + Uom: article.Uom, ReplenishTime: grmi.DateTime(time.Now()), - ArtType: articleWithReplenish.Article.ArtType, - ArtName: articleWithReplenish.Article.Descr1, + ArtType: article.ArtType, + ArtName: article.Descr1, Status: model.REPLENISH_ORDER_STATUS_ON, } err = replenishDao.InsertOne(&replenishOrder) @@ -684,6 +684,7 @@ func (impl *InventoryCheckHeadServiceImplement) AccomplishCheckHead(user *models _ = session.Rollback() return err } + lst.InventoryCheckId = entity.InventoryCheckId lstLi[index] = lst } err = lstDao.Insert(&lstLi) diff --git a/web/controllers/wm/InventoryCheckHead.rest.go b/web/controllers/wm/InventoryCheckHead.rest.go index d3bc907..0d747f7 100644 --- a/web/controllers/wm/InventoryCheckHead.rest.go +++ b/web/controllers/wm/InventoryCheckHead.rest.go @@ -384,7 +384,7 @@ func RegisterUpdateInventoryCheckHead(party router.Party, path string, method fu ******************************************************************************/ func RegisterAccomplishInventoryCheckHead(party router.Party, path string, method func(*models.Usertab, *model.InventoryCheckHead) error) { - party.Get(path, func(ctx iris.Context) { + party.Post(path, func(ctx iris.Context) { user, ok := jwts.ParseToken(ctx) if !ok { supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil)