admin
2024-10-22 f6aa411801444444fd0216322d96c2e2f3bed9c7
连续排产优化
已修改2个文件
25 ■■■■ 文件已修改
_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_ContinuousProductionScheduling.qbl
@@ -17,7 +17,8 @@
    
    
    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;
@@ -51,14 +52,17 @@
        // 需要处理的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 );
_Main/BL/Type_WholeShift/Method_MobileCycleTask.qbl
@@ -8,6 +8,17 @@
  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();
  *]
}