| | |
| | | |
| | | |
| | | while ( needHandleUPTBs.Size() > 0 ) { |
| | | debuginfo( "-------------------------------------------", "正在处理的周开始时间:", indexStartDate.Format( "Y-M2-D2" ), " 处理的个数:", needHandleUPTBs.Size() ); |
| | | debuginfo( "-------------------------------------------", "正在处理的周开始时间:", indexStartDate.Format( "Y-M2-D2" ), |
| | | " 正在处理的周结束时间:", ( indexStartDate.StartOfNextWeek() - 1 ).Format( "Y-M2-D2" ), " 处理的个数:", needHandleUPTBs.Size() ); |
| | | |
| | | // 需要处理标志 |
| | | needHandleFlag := false; |
| | |
| | | // 需要处理的UPTB的最大时间 |
| | | handleIndexEndDate := maxobject( needHandleUPTBs, Elements, tempUPTB, true, tempUPTB.StartDate() ).StartDate(); |
| | | |
| | | debuginfo( "需要处理的周开始时间:", indexStartDate.Format( "Y-M2-D2" ), " 需要处理的周结束时间:", handleIndexEndDate.Format( "Y-M2-D2" ), |
| | | " 第一次出现产能的日期:", firstAppearCapacityDate1.Format( "Y-M2-D2" ) ); |
| | | // debuginfo( "需要处理的周开始时间:", indexStartDate.Format( "Y-M2-D2" ), " 需要处理的周结束时间:", handleIndexEndDate.Format( "Y-M2-D2" ), |
| | | // " 第一次出现产能的日期:", firstAppearCapacityDate1.Format( "Y-M2-D2" ) ); |
| | | needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate ); |
| | | |
| | | while ( needFillUPTB.UsedCapacity().HoursAsReal() <= 0.0 and handleIndexStartDate <= handleIndexEndDate ) { |
| | | while ( guard( needFillUPTB.UsedCapacity().HoursAsReal(), -1 ) <= 0.0 and handleIndexStartDate <= handleIndexEndDate ) { |
| | | targetUPTB := minselect( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() > handleIndexStartDate and tempUPTB.UsedCapacity().HoursAsReal() > 0.0, tempUPTB.StartDate() ); |
| | | |
| | | // 移动周期任务 |
| | | if ( not isnull( needFillUPTB ) and not isnull( targetUPTB ) ) { |
| | | this.MobileCycleTask( needFillUPTB, targetUPTB ); |
| | | } |
| | | |
| | | handleIndexStartDate := handleIndexStartDate + 1; |
| | | needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate ); |
| | |
| | | Description: '连续生产,移动两个周期任务' |
| | | TextBody: |
| | | [* |
| | | // vwedadmin Oct-22-2024 (created) |
| | | debuginfo( "需要填充的日期:", fillUPTB.StartDate().Format( "Y-M2-D2" ), " 目标被取数日期:", targetUPTB.StartDate().Format( "Y-M2-D2" ) ); |
| | | |
| | | // 判断可用产能是否一致 |
| | | if ( fillUPTB.BaseAvailableCapacity().HoursAsReal() = targetUPTB.BaseAvailableCapacity().HoursAsReal() ) { |
| | | traverse ( targetUPTB, PeriodTaskOperation, pto ) { |
| | | PeriodTaskOperation::Create( pto.Operation(), fillUPTB, pto.Quantity(), false ); |
| | | } |
| | | |
| | | PeriodTaskOperation::Delete( selectset( targetUPTB, PeriodTaskOperation, tempPTO, true ) ); |
| | | } |
| | | |
| | | Transaction::Transaction().Propagate(); |
| | | *] |
| | | } |