Quintiq file version 2.0
|
#parent: #root
|
StaticMethod GenerateData (
|
InterfaceDataset owner,
|
String werk,
|
const MacroPlan macroplan,
|
Date startdate,
|
Date enddate,
|
String executor
|
)
|
{
|
TextBody:
|
[*
|
// 甄兰鸽 Aug-23-2024 (created)
|
cdlast := maxobject( owner, AOnlineAndMOfflinePlanPIR, cd, cd.StartDate(), cd.EndDate(), cd.Werk() );
|
if( not isnull( cdlast ) ){
|
loginfo := cdlast.InterfaceLoginfo();
|
if( not loginfo.IsShow() ){
|
loginfo.Delete();
|
}else{
|
loginfo.Last( false );
|
}
|
owner.AOnlineAndMOfflinePlanPIR( relflush );
|
}
|
nowdate := DateTime::ActualTime();
|
loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor
|
, Name := Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_Name()
|
, InterfaceDateTime := nowdate
|
, Message := '装配上线计划 + 机加下线计划 - PIR'
|
, IsShow := false
|
, Last := true
|
, ReturnSuccess := true
|
, ReturnMsg := 'Success'
|
, Success := true
|
);
|
pir := owner.AOnlineAndMOfflinePlanPIR( relnew, Werk := werk, Version := macroplan.ScenarioName(), StartDate := startdate, EndDate := enddate );
|
loginfo.AOnlineAndMOfflinePlanPIR( relinsert, pir );
|
traverse( macroplan, AssemblyOnlinePlanColumn, column ){
|
traverse( column, AssemblyOnlinePlanCell, cell, cell.Value() <> '' and cell.AssemblyOnlinePlanRow().RowNr() = '1' ){
|
quantityrow := cell.AssemblyOnlinePlanRow();
|
|
pir.PIRData( relnew, Product := quantityrow.ProductID()
|
, PlanningDate := column.ColumnDate()
|
, PlanningQty := [Number]cell.Value());
|
}
|
}
|
|
traverse( macroplan, OfflinePlanTable, table ){
|
traverse( table, OfflinePlanColumn, column ){
|
traverse( column, OfflinePlanCell, cell, cell.Value() <> ''
|
and ( cell.OfflinePlanRow().ProductionLine() <> 'DL_MOMO' or cell.OfflinePlanRow().ProductionLine() <> 'CC_MOMO' ) ){
|
row := cell.OfflinePlanRow();
|
|
pir.PIRData( relnew, Product := row.ProductID()
|
, PlanningDate := column.ColumnDate()
|
, PlanningQty := [Number]cell.Value());
|
}
|
}
|
}
|
loginfo.TotalRow( pir.PIRData( relsize ) );
|
*]
|
}
|