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