Browse Source

Merge pull request 'wms 盘点bug修改' (#54) from feature_wms into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_LF_MOM_BACKEND/pulls/54
Reviewed-by: zhangxin <xin.zhang@le-it.com.cn>
pull/56/head
zhangxin 3 years ago
parent
commit
3f3d166316
2 changed files with 11 additions and 10 deletions
  1. +10
    -9
      services/wm/implments/InventoryCheckHead.service.impl.go
  2. +1
    -1
      web/controllers/wm/InventoryCheckHead.rest.go

+ 10
- 9
services/wm/implments/InventoryCheckHead.service.impl.go View File

@ -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)


+ 1
- 1
web/controllers/wm/InventoryCheckHead.rest.go View File

@ -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)


Loading…
Cancel
Save