Browse Source

修改错误提示信息 添加对需求小于0的处理

pull/134/head
zhangxin 3 years ago
parent
commit
aa75d38ed5
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      services/ap/implments/Balance.service.impl.go

+ 4
- 1
services/ap/implments/Balance.service.impl.go View File

@ -3041,7 +3041,7 @@ func (impl *BalanceServiceImplement) MpsPlanExport(user *global.User, CustArtSto
return "", grmi.NewBusinessError("查询物料需求数据失败, 错误:" + err.Error())
}
if len(artDemandLi) == 0 {
return "", grmi.NewBusinessError("未查询到需要到处的需求数据")
return "", grmi.NewBusinessError("未查询到需要导导出的需求数据")
}
// 构建map数据 map[artId]map[demandKey]model.ArticleDemand
artOpeningInventoryMap := make(map[string]float64)
@ -3091,6 +3091,9 @@ func (impl *BalanceServiceImplement) MpsPlanExport(user *global.User, CustArtSto
qty = artDemand.OrderQty
}
qty = qty + artDemand.IndependentDemandQty - artDemand.OutSourcingQty
if qty < 0 {
qty = 0
}
demandQty.Qty += qty
productQty.Qty += artDemand.NetDemandQty
artDemandData.OutSourcingQty += artDemand.OutSourcingQty


Loading…
Cancel
Save