| | |
| | | now := DateTime::Now(); |
| | | macroPlanName := macroPlan.MDSMacroPlan().Description(); |
| | | traverse( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan,shiftPlan ,shiftPlan.UnitPeriodTime().Period_MP().StartDate() >= macroPlan.StartOfPlanning().Date()){ |
| | | factory := shiftPlan.UnitPeriodTime().Unit(); |
| | | while( factory.HasParent() ){ |
| | | temp1 := factory; |
| | | factory := factory.Parent(); |
| | | if( not factory.HasParent() ){ |
| | | factory := temp1; |
| | | } |
| | | } |
| | | factory := LocalTool::GetFactoryByUnit( shiftPlan.UnitPeriodTime().Unit() ); |
| | | |
| | | productLine := shiftPlan.UnitPeriodTime().Unit().ID(); |
| | | shiftDate := shiftPlan.UnitPeriodTime().Period_MP().StartDate(); |
| | | factoryName := factory.ID(); |
| | |
| | | unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue )); |
| | | if( not isnull( unitIndex )){ |
| | | unit := units.Element( unitIndex.GetValueAsNumber() ); |
| | | temp1 := unit; |
| | | temp2 := unit.Parent(); |
| | | while( not isnull( temp1.Parent())){ |
| | | temp2 := temp1; |
| | | temp1 := temp1.Parent(); |
| | | } |
| | | factory := temp2; |
| | | factory := LocalTool::GetFactoryByUnit( unit ); |
| | | } |
| | | } |
| | | |
对比新文件 |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetFactoryByUnit ( |
| | | const Unit unit |
| | | ) const as const Unit |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Akari Nov-11-2024 (created) |
| | | factory := constnull( Unit ); |
| | | |
| | | if( isnull( unit ) or isnull( unit.Parent())){ |
| | | factory := unit; |
| | | }else{ |
| | | temp1 := unit; |
| | | temp2 := unit.Parent(); |
| | | while( not isnull( temp1.Parent())){ |
| | | temp2 := temp1; |
| | | temp1 := temp1.Parent(); |
| | | } |
| | | factory := temp2; |
| | | } |
| | | |
| | | return factory; |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | traverse( archive,ArchiveFile,object ){ |
| | | // object.Name(); |
| | | // object.FilePath(); |
| | | // object.SourceFileBinaryValue(); |
| | | traverse( macroPlan,Unit,unit ){ |
| | | info( LocalTool::GetFactoryByUnit( unit ).ID() ); |
| | | } |
| | | *] |
| | | } |