|
|
@ -90,9 +90,9 @@ func (impl *BalanceServiceImplement) GetCustomerArticleDemand(user *global.User, |
|
|
|
return nil, grmi.NewDataBaseError(err) |
|
|
|
} |
|
|
|
|
|
|
|
if CustomerId == ""&&ArtId == ""&&Planner==""{ |
|
|
|
return nil, grmi.NewDataBaseError(err) |
|
|
|
} |
|
|
|
//if CustomerId == ""&&ArtId == ""&&Planner==""{
|
|
|
|
// return nil, grmi.NewDataBaseError(err)
|
|
|
|
//}
|
|
|
|
|
|
|
|
var custArtlst1,custArtlst2,custArtlst3 []model.CustArtlst |
|
|
|
var CustomerList []interface{} |
|
|
@ -220,6 +220,17 @@ func (impl *BalanceServiceImplement) GetCustomerArticleDemand(user *global.User, |
|
|
|
data[index].ArticleDemandLst = data_ArticleDemand_new |
|
|
|
} |
|
|
|
|
|
|
|
//去空
|
|
|
|
size := len(data) |
|
|
|
for i := 0; i < size; i++ { |
|
|
|
if data[i].ArticleDemandLst == nil { |
|
|
|
data = append(data[:i], data[i+1:]...) |
|
|
|
i-- |
|
|
|
size-- |
|
|
|
} |
|
|
|
} |
|
|
|
data = data[:size] |
|
|
|
|
|
|
|
//var CustArtStockItemLst []model.CustArtStockItem
|
|
|
|
var CustArtStockaLL model.CustArtStockItem |
|
|
|
CustArtStockaLL.ItemLst = *new([]map[string]string) |
|
|
@ -469,15 +480,15 @@ func (impl *BalanceServiceImplement) RefreshCustomerArticleDemand(user *global.U |
|
|
|
if artStockInfo.ArtId == ArtId { |
|
|
|
switch artStockInfo.StockType { |
|
|
|
case "FG": |
|
|
|
custArtStockInfo.FGStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.FGStock = artStockInfo.FGQty |
|
|
|
case "SFG": |
|
|
|
custArtStockInfo.SFGStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.SFGStock = artStockInfo.SFGQty |
|
|
|
case "WIP": |
|
|
|
custArtStockInfo.WIPStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.WIPStock = artStockInfo.WIPQty |
|
|
|
case "PUC": |
|
|
|
custArtStockInfo.PUCStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.PUCStock = artStockInfo.PUCQty |
|
|
|
case "OSC": |
|
|
|
custArtStockInfo.OSCStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.OSCStock = artStockInfo.OSCQty |
|
|
|
} |
|
|
|
break |
|
|
|
} |
|
|
@ -2213,15 +2224,15 @@ func (impl *BalanceServiceImplement) MpsPlan(user *global.User, resouceId, secon |
|
|
|
if artStockInfo.ArtId == custArtInfo.ArtId { |
|
|
|
switch artStockInfo.StockType { |
|
|
|
case "FG": |
|
|
|
custArtStockInfo.FGStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.FGStock = artStockInfo.FGQty |
|
|
|
case "SFG": |
|
|
|
custArtStockInfo.SFGStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.SFGStock = artStockInfo.SFGQty |
|
|
|
case "WIP": |
|
|
|
custArtStockInfo.WIPStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.WIPStock = artStockInfo.WIPQty |
|
|
|
case "PUC": |
|
|
|
custArtStockInfo.PUCStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.PUCStock = artStockInfo.PUCQty |
|
|
|
case "OSC": |
|
|
|
custArtStockInfo.OSCStock = artStockInfo.ActualStock |
|
|
|
custArtStockInfo.OSCStock = artStockInfo.OSCQty |
|
|
|
} |
|
|
|
break |
|
|
|
} |
|
|
@ -2875,7 +2886,9 @@ func (impl *BalanceServiceImplement) RefreshBalanceData(user *global.User) error |
|
|
|
|
|
|
|
|
|
|
|
//需求周期 > 当前时间+ mps策略表偏离周数 并且 需求周期 < (当前时间+吸收期+最大覆盖周期)
|
|
|
|
if timeNow.After(info.DemandDate.Restore()){ |
|
|
|
weekTimeNow := utils.WeekDayMondayZeroTs(timeNow) |
|
|
|
weekTimeDemand := utils.WeekDayMondayZeroTs(info.DemandDate.Restore()) |
|
|
|
if weekTimeNow.After(weekTimeDemand){ |
|
|
|
continue |
|
|
|
} |
|
|
|
if info.DemandDate.Restore().After(timeNow.Add(time.Duration((int(MaxCoverPeriod)+lockWeeks)*24*7) * time.Hour)){ |
|
|
|