|
|
@ -2990,32 +2990,34 @@ func (impl *BalanceServiceImplement) PublishMpsPlan(user *global.User, version s |
|
|
|
} |
|
|
|
|
|
|
|
//todo mpsSetting.UseCustDemandLockToggle
|
|
|
|
if mpsSetting.UseCustDemandLockToggle { |
|
|
|
var customerIdLi []string |
|
|
|
var customerLi []model_base.Customer |
|
|
|
for _, CustArt := range alldata_CustArtlst{ |
|
|
|
if articleDemand.ArtId == CustArt.ArtId{ |
|
|
|
customerIdLi = append(customerIdLi, CustArt.CustomerId) |
|
|
|
} |
|
|
|
} |
|
|
|
for _, customer := range customerIdLi { |
|
|
|
for _, custInfo := range alldata_Customer{ |
|
|
|
if custInfo.CustomerId == customer{ |
|
|
|
customerLi = append(customerLi, custInfo) |
|
|
|
if lockWeeks == 0{ |
|
|
|
if mpsSetting.UseCustDemandLockToggle { |
|
|
|
var customerIdLi []string |
|
|
|
var customerLi []model_base.Customer |
|
|
|
for _, CustArt := range alldata_CustArtlst{ |
|
|
|
if articleDemand.ArtId == CustArt.ArtId{ |
|
|
|
customerIdLi = append(customerIdLi, CustArt.CustomerId) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for _, customer := range customerLi{ |
|
|
|
if customer.LockWeeks > lockWeeks { |
|
|
|
lockWeeks = customer.LockWeeks |
|
|
|
for _, customer := range customerIdLi { |
|
|
|
for _, custInfo := range alldata_Customer{ |
|
|
|
if custInfo.CustomerId == customer{ |
|
|
|
customerLi = append(customerLi, custInfo) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for _, customer := range customerLi{ |
|
|
|
if customer.LockWeeks > lockWeeks { |
|
|
|
lockWeeks = customer.LockWeeks |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if lockWeeks == 0{ |
|
|
|
if lockWeeks == 0{ |
|
|
|
lockWeeks = mpsSetting.DefaultLockWeeks |
|
|
|
} |
|
|
|
}else{ |
|
|
|
lockWeeks = mpsSetting.DefaultLockWeeks |
|
|
|
} |
|
|
|
}else{ |
|
|
|
lockWeeks = mpsSetting.DefaultLockWeeks |
|
|
|
} |
|
|
|
|
|
|
|
if lockWeeks == 0 { |
|
|
@ -3430,31 +3432,33 @@ func (impl *BalanceServiceImplement) RefreshBalanceData(user *global.User) error |
|
|
|
} |
|
|
|
|
|
|
|
//todo
|
|
|
|
if mpsSettingOne.UseCustDemandLockToggle { |
|
|
|
|
|
|
|
for _, customer := range customerLi{ |
|
|
|
if customer.LockWeeks > lockWeeks { |
|
|
|
lockWeeks = customer.LockWeeks |
|
|
|
if lockWeeks == 0{ |
|
|
|
if mpsSettingOne.UseCustDemandLockToggle { |
|
|
|
for _, customer := range customerLi{ |
|
|
|
if customer.LockWeeks > lockWeeks { |
|
|
|
lockWeeks = customer.LockWeeks |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if lockWeeks == 0{ |
|
|
|
if lockWeeks == 0{ |
|
|
|
lockWeeks = mpsSettingOne.DefaultLockWeeks |
|
|
|
} |
|
|
|
}else{ |
|
|
|
lockWeeks = mpsSettingOne.DefaultLockWeeks |
|
|
|
} |
|
|
|
}else{ |
|
|
|
lockWeeks = mpsSettingOne.DefaultLockWeeks |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if lockWeeks == 0 { |
|
|
|
return grmi.NewBusinessError( "未获取到吸收期:"+ info.ArtId) |
|
|
|
} |
|
|
|
|
|
|
|
var custArticleList []model.CustArtlst |
|
|
|
for _, custArticle := range alldata_CustArtlst{ |
|
|
|
if custArticle.ArtId == info.ArtId{ |
|
|
|
custArticleList = append(custArticleList, custArticle) |
|
|
|
} |
|
|
|
} |
|
|
|
//var custArticleList []model.CustArtlst
|
|
|
|
//for _, custArticle := range alldata_CustArtlst{
|
|
|
|
// if custArticle.ArtId == info.ArtId{
|
|
|
|
// custArticleList = append(custArticleList, custArticle)
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
if mpsSettingOne.UseFixedStockCoverToggle { |
|
|
|
MinCoverPeriod = mpsSettingOne.DefaultMinCoverPeriod |
|
|
|