xiaoding721
2024-10-17 ffb76f7a9a094cd200367d23b6822f4c1f7c873c
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
@@ -12,10 +12,11 @@
      table.Delete(); 
    }
    
    zeroDuration := Duration::Construct( 0,0,0,0 );
    table := owner.MP_Table( relnew,Name := MP_Cell_ScheduleSummary::GetTableName());
    
    startDate := owner.StartOfPlanning().Date();
    endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate();
    
    columns := construct( MP_Columns );
@@ -40,9 +41,14 @@
        columnHandle := columnIndexTree.GetHandle( unitPeriodTime.Period_MP().StartDate().AsQUILL() );
        columnIndex := guard( columnIndexTree.Root().Child( columnHandle ),null( NamedValue ));
        if( not isnull( columnIndex )){
          // 当arrowedAvailableCapacity不为0,工作日 + 1
          arrowedAvailableCapacity := unitPeriodTime.TotalAvailableCapacity();
          zeroDuration := Duration::Construct( 0,0,0,0 );
          workDay := ifexpr( arrowedAvailableCapacity <> zeroDuration, 1,0 );
          if( workDay = 0 ){
            workDay := ifexpr( unitPeriodTime.ShiftPlan().Outcome() <> "",1,0 );
          }
          
          column := columns.Element( columnIndex.GetValueAsNumber() );
          
@@ -50,7 +56,7 @@
          workHours := select( unitPeriodTime,ShiftPattern.ShiftDay,shifDay,shifDay.Day_MP().ID() = dayOfWeek );
          capacity := 0.0;
          
          workDay := ifexpr( arrowedAvailableCapacity <> zeroDuration, 1,0 );
          if( not isnull( workHours )){
            capacity := workDay * throughput * workHours.Capacity().HoursAsReal()
          }