|
|
@ -2915,26 +2915,26 @@ func (impl *BalanceServiceImplement) PublishMpsPlan(user *global.User, version s |
|
|
|
planOrderList = append(planOrderList, planOrder) |
|
|
|
} |
|
|
|
|
|
|
|
if info.OutSourcingQty-info.OriginOutSourcingQty > 0 { |
|
|
|
date := info.DemandDate |
|
|
|
if !utils.WeekDayMondayZeroTs(info.DemandDate.Restore()).Before(utils.WeekDayMondayZeroTs(time.Now())) { |
|
|
|
date = grmi.Date(time.Now()) |
|
|
|
} |
|
|
|
IndependentDemandQty := model.ArticleIndependentDemand{ |
|
|
|
PlantNr: user.PlantNr, |
|
|
|
ArtId: info.ArtId, |
|
|
|
DemandKey: info.DemandKey, |
|
|
|
VersionNr: data_PlanOrderVersion.VersionNr, |
|
|
|
ProjectId: info.ProjectId, |
|
|
|
CustomerId: info.CustomerId, |
|
|
|
DemandDate: date, |
|
|
|
DemandYear: info.DemandYear, |
|
|
|
DemandWeek: info.DemandWeek, |
|
|
|
DemandMonth: info.DemandMonth, |
|
|
|
DemandQty: info.OutSourcingQty - info.OriginOutSourcingQty, |
|
|
|
} |
|
|
|
IndependentDemandQtyList = append(IndependentDemandQtyList, IndependentDemandQty) |
|
|
|
} |
|
|
|
//if info.OutSourcingQty-info.OriginOutSourcingQty > 0 {
|
|
|
|
// date := info.DemandDate
|
|
|
|
// if !utils.WeekDayMondayZeroTs(info.DemandDate.Restore()).Before(utils.WeekDayMondayZeroTs(time.Now())) {
|
|
|
|
// date = grmi.Date(time.Now())
|
|
|
|
// }
|
|
|
|
// IndependentDemandQty := model.ArticleIndependentDemand{
|
|
|
|
// PlantNr: user.PlantNr,
|
|
|
|
// ArtId: info.ArtId,
|
|
|
|
// DemandKey: info.DemandKey,
|
|
|
|
// VersionNr: data_PlanOrderVersion.VersionNr,
|
|
|
|
// ProjectId: info.ProjectId,
|
|
|
|
// CustomerId: info.CustomerId,
|
|
|
|
// DemandDate: date,
|
|
|
|
// DemandYear: info.DemandYear,
|
|
|
|
// DemandWeek: info.DemandWeek,
|
|
|
|
// DemandMonth: info.DemandMonth,
|
|
|
|
// DemandQty: info.OutSourcingQty - info.OriginOutSourcingQty,
|
|
|
|
// }
|
|
|
|
// IndependentDemandQtyList = append(IndependentDemandQtyList, IndependentDemandQty)
|
|
|
|
//}
|
|
|
|
// 已发布
|
|
|
|
info.Status = 2 |
|
|
|
info.PublishedVersionNr = version |
|
|
|