| | |
| | | #parent: #root |
| | | StaticMethod Dispatch ( |
| | | InterfaceDataset interfaceDataset, |
| | | const MacroPlan macroPlan, |
| | | const Archive archive, |
| | | String executor |
| | | ) |
| | | { |
| | |
| | | } |
| | | |
| | | now := DateTime::Now(); |
| | | macroPlanName := macroPlan.MDSMacroPlan().Description(); |
| | | traverse( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan,shiftPlan ,shiftPlan.UnitPeriodTime().Period_MP().StartDate() >= macroPlan.StartOfPlanning().Date()){ |
| | | factory := LocalTool::GetFactoryByUnit( shiftPlan.UnitPeriodTime().Unit() ); |
| | | traverse( archive,ArchiveShiftPlanRow.ArchiveShiftPlanCell,archiveShiftPlan ){ |
| | | factoryName := archiveShiftPlan.ArchiveShiftPlanRow().FactoryName(); |
| | | |
| | | productLine := shiftPlan.UnitPeriodTime().Unit().ID(); |
| | | shiftDate := shiftPlan.UnitPeriodTime().Period_MP().StartDate(); |
| | | factoryName := factory.ID(); |
| | | productLine := archiveShiftPlan.ArchiveShiftPlanRow().UnitID(); |
| | | shiftDate := archiveShiftPlan.ArchiveShiftPlanColumn().StartDate(); |
| | | |
| | | dispatchShiftPlanHandle := dispatchShiftPlanIndexTree.GetHandle( factoryName + productLine + shiftDate.AsQUILL() ); |
| | | dispatchShiftPlanIndex := guard( dispatchShiftPlanIndexTree.Root().Child( dispatchShiftPlanHandle ),null( NamedValue )); |
| | | if( not isnull( dispatchShiftPlanIndex )){ |
| | | dispatchShiftPlan := dispatchShiftPlans.Element( dispatchShiftPlanIndex.GetValueAsNumber() ); |
| | | dispatchShiftPlan.Tips( shiftPlan.Remark() ); |
| | | dispatchShiftPlan.VersionName( macroPlanName ); |
| | | dispatchShiftPlan.Tips( archiveShiftPlan.Remark() ); |
| | | dispatchShiftPlan.VersionName( archiveShiftPlan.MacroPlanName() ); |
| | | dispatchShiftPlan.InterfaceTime( now ); |
| | | }else{ |
| | | if( shiftPlan.Outcome() <> "" ){ |
| | | if( archiveShiftPlan.Outcome() <> "" ){ |
| | | interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(), |
| | | ProductLine := productLine, |
| | | FactoryName := factory.ID(), |
| | | ShiftQty := shiftPlan.Outcome(), |
| | | FactoryName := factoryName, |
| | | ShiftQty := archiveShiftPlan.Outcome(), |
| | | |
| | | ShiftDate := shiftDate, |
| | | Tips := shiftPlan.Remark(), |
| | | VersionName := macroPlanName, |
| | | Tips := archiveShiftPlan.Remark(), |
| | | VersionName := archiveShiftPlan.MacroPlanName(), |
| | | InterfaceTime := now ); |
| | | } |
| | | } |