admin
2024-08-28 383df1b4a1b7b9903cd4f0843d06e04674d42a1f
整班优化
已修改4个文件
24 ■■■■■ 文件已修改
_Main/BL/Type_WholeShift/Method_CapacityRounding.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_IsRoundingOrZeroFilling3.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_ProcessingTimeIntervalIsEqualToOneDay.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_ZeroCapacityReplenishment.qbl 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_CapacityRounding.qbl
@@ -9,7 +9,8 @@
{
  TextBody:
  [*
    debuginfo( "需要圆整的时间(单位:小时)", timeDifference, "    需要圆整的产能周期的开始时间:", uptb.StartDate().Format( "Y-M2-D2" ) );
    debuginfo( "需要圆整的时间(单位:小时)", timeDifference, "    Free capacity(单位:小时)", uptb.FreeCapacity().HoursAsReal(), "    ChangeoverDuration(单位:小时)", uptb.ChangeoverDuration().HoursAsReal(), "    需要圆整的产能周期的开始时间:", uptb.StartDate().Format( "Y-M2-D2" ) );
    //timeDifference         := uptb.FreeCapacity().HoursAsReal() - uptb.ChangeoverDuration().HoursAsReal();
    nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) );
    //debuginfo( "考虑库存和lotsize" );
    //while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) ) {
_Main/BL/Type_WholeShift/Method_IsRoundingOrZeroFilling3.qbl
@@ -7,10 +7,10 @@
{
  TextBody:
  [*
    traverse ( uptbs, Elements, uptb, true ) {
    traverse ( uptbs, Elements, uptb, true/*uptb.StartDate() <= Date::Construct( 2024, 4, 23 )*/ ) {
      if ( ( uptb.End().Date() - uptb.StartDate() ) > 1 ) {  
        debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), "    结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), "    时间区间:", ( uptb.End().Date() - uptb.StartDate() ) );
        this.ProcessingTimeIntervalIsGreaterThanOneDay( macroPlan, uptb, uptbs );
    //    debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), "    结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), "    时间区间:", ( uptb.End().Date() - uptb.StartDate() ) );
    //    this.ProcessingTimeIntervalIsGreaterThanOneDay( macroPlan, uptb, uptbs );
      } else if ( ( uptb.End().Date() - uptb.StartDate() ) = 1 ) {
        debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), "    结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), "    时间区间:", ( uptb.End().Date() - uptb.StartDate() ) );
        this.ProcessingTimeIntervalIsEqualToOneDay( macroPlan, uptb, uptbs );
_Main/BL/Type_WholeShift/Method_ProcessingTimeIntervalIsEqualToOneDay.qbl
@@ -9,7 +9,7 @@
  Description: '处理时间区间等于1天'
  TextBody:
  [*
    if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() ) {
    if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() or ( uptb.UtilizationPercentage() * uptb.MaximumLoadPercentage() / 100 ) = 100 or uptb.FreeCapacity().HoursAsReal() = 0 ) {
      debuginfo( "天已经是整班,无需处理(使用产能等于可用产能)" );
    } else if ( uptb.UsedCapacity().HoursAsReal() = 0 ) {
      debuginfo( "天已经是整班,无需处理(使用产能等于0)" );
@@ -33,7 +33,7 @@
        this.ZeroCapacityReplenishment( macroPlan, uptb.UsedCapacity().HoursAsReal(), uptb, uptbs ); 
      } else {
        debuginfo( "执行圆整" );
        this.CapacityRounding( macroPlan, uptb.TotalAvailableCapacity().HoursAsReal() - uptb.UsedCapacity().HoursAsReal(), uptb, uptbs );
        this.CapacityRounding( macroPlan, uptb.TotalAvailableCapacity().HoursAsReal() - ( uptb.UsedCapacity() + uptb.ChangeoverDuration() ).HoursAsReal(), uptb, uptbs );
      }
    } else {
      debuginfo( "天出现异常" );
_Main/BL/Type_WholeShift/Method_ZeroCapacityReplenishment.qbl
@@ -77,16 +77,21 @@
      minimumCapacityThatCanBeBorrowed := minimumQuantityThatCanBeBorrowed / pto.Operation().Throughput();
      nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) );
      while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) and minimumCapacityThatCanBeBorrowed > 0 ) {
        acceptableCapacity := ifexpr( ( nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal() ) > 0,
        acceptableCapacity := /*ifexpr( ( nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal() ) > 0,
                                        nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal(),
                                        0.0 );
                                        0.0 )*/
                              ifexpr( nextUnitPeriodTimeBase.FreeCapacity().HoursAsReal() > 0,
                                      nextUnitPeriodTimeBase.FreeCapacity().HoursAsReal(),
                                      0.0 );
        unifiedProcessingTimeOfComplementZero := minvalue( timeDifference, minimumCapacityThatCanBeBorrowed, acceptableCapacity );
        debuginfo( "接纳的周期时间:", nextUnitPeriodTimeBase.StartDate().Format( "Y-M2-D2" ), String::Tab(), 
                   "接纳的周期能接受的产能:", acceptableCapacity, String::Tab(),
                   "剩余补零的产能:", timeDifference, String::Tab(),
                   "统一转移的产能:", unifiedProcessingTimeOfComplementZero, String::Tab()
                  );
        this.UnifiedProcessingOfComplementZeroLogic( unifiedProcessingTimeOfComplementZero, pto, uptb, macroPlan );
        if ( unifiedProcessingTimeOfComplementZero > 0.0 ) {
          this.UnifiedProcessingOfComplementZeroLogic( unifiedProcessingTimeOfComplementZero, pto, nextUnitPeriodTimeBase, macroPlan );
        }
        minimumCapacityThatCanBeBorrowed := minimumCapacityThatCanBeBorrowed - unifiedProcessingTimeOfComplementZero;
        timeDifference := timeDifference - unifiedProcessingTimeOfComplementZero;
        if ( isnull( nextUnitPeriodTimeBase.Next() ) ) {