xiaoding721
2024-12-11 922e32f3483318a2f733b8a3d9074264d6bd3613
修复一些bug
已添加3个文件
已修改2个文件
294 ■■■■■ 文件已修改
_Main/BL/Type_DispatchShiftProductionInformation/Attribute_OrderNumber.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateFullTable.qbl 129 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateHistoryTempTable.qbl 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/StaticMethod_GetWorkHoursByShiftPatternName.qbl 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftProductionInformation/Attribute_OrderNumber.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute OrderNumber
{
  #keys: '3[414996.1.268920158][414996.1.268920157][414996.1.268920159]'
  ValueType: Number
}
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -51,7 +51,7 @@
        }
      }
      
      traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
      traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate() and cell.Quantity() > 0){
        product := null( DispatchShiftSchedulingProduct );
        tips := "";
        if( not isnull( unit )){
@@ -77,6 +77,7 @@
          productIndex := guard( productIndexTree.Root().Child( productHandle ),null( NamedValue ));
          if( isnull( productIndex )){
            product := line.DispatchShiftSchedulingProduct( relnew,ProductID := row.ProductID() );
            product.OrderNumber( cell.OrderNr() );
            product.ProductionQuantity( cell.Quantity() );
            products.Add( product );
            productIndexTree.Root().AddChild( productHandle,products.Size() - 1 );
@@ -106,7 +107,7 @@
        }
      }
      
      traverse( row,NewAssemblyOnlinePlanCell,cell, startDate <= cell.NewAssemblyOnlinePlanColumn().StartDate() and endDate >= cell.NewAssemblyOnlinePlanColumn().EndDate()){
      traverse( row,NewAssemblyOnlinePlanCell,cell, startDate <= cell.NewAssemblyOnlinePlanColumn().StartDate() and endDate >= cell.NewAssemblyOnlinePlanColumn().EndDate() and cell.Quantity() > 0){
        product := null( DispatchShiftSchedulingProduct );
        tips := "";
        if( not isnull( unit )){
@@ -132,6 +133,7 @@
          productIndex := guard( productIndexTree.Root().Child( productHandle ),null( NamedValue ));
          if( isnull( productIndex )){
            product := line.DispatchShiftSchedulingProduct( relnew,ProductID := row.ProductID() );
            product.OrderNumber( cell.OrderNr() );
            product.ProductionQuantity( cell.Quantity() );
            products.Add( product );
            productIndexTree.Root().AddChild( productHandle,products.Size() - 1 );
@@ -157,7 +159,7 @@
      // 481
      lineQuantity := line.LineQuantity();
      
      tempProducts := selectsortedset( line,DispatchShiftSchedulingProduct,object,object.ProductionQuantity() );
      tempProducts := selectsortedset( line,DispatchShiftSchedulingProduct,object,object.OrderNumber() );
      
      if( line.ShiftName() = "3" ){
        
@@ -188,7 +190,7 @@
          }
        }
        
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
        for( i := 0;i < tempProducts.Size(); i++ ){
          product := tempProducts.Element( i );
          productionQuantity := product.ProductionQuantity();
          
@@ -214,7 +216,9 @@
            singleShiftVolume3 := singleShiftVolume3 - productionQuantity;
            productionQuantity := productionQuantity - detail.ShiftVolume();
          }else{
            product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := 0 ,SingleShiftName := "三班");
            if( i = tempProducts.Size() - 1 ){
              product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := 0 ,SingleShiftName := "三班");
            }
          }
        }
        
@@ -242,7 +246,7 @@
          }
        }
    
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
        for( i := 0 ;i < tempProducts.Size(); i++ ){
          product := tempProducts.Element( i );
          productionQuantity := product.ProductionQuantity();
          
@@ -262,13 +266,17 @@
            detail := product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := ifexpr( tempProductQuantity > 0 ,productionQuantity,singleShiftVolume2 ) ,SingleShiftName := "二班");
            singleShiftVolume2 := singleShiftVolume2 - productionQuantity;
            productionQuantity := productionQuantity - detail.ShiftVolume();
          }else{
            if( i = tempProducts.Size() - 1 ){
              product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := 0 ,SingleShiftName := "二班");
            }
          }
        }
        
      }else if( line.ShiftName() = "1" ){
        singleShiftVolume1 := lineQuantity;
        
        for( i := tempProducts.Size() - 1;i >= 0; i-- ){
        for( i := 0 ;i < tempProducts.Size(); i++ ){
          product := tempProducts.Element( i );
          productionQuantity := product.ProductionQuantity();
          if( singleShiftVolume1 > 0 and productionQuantity > 0){
_Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateFullTable.qbl
@@ -85,66 +85,8 @@
      unitIndexTree.Root().AddChild( unitHandle,i );
    }
    
    //// å¼€å§‹æ‹¼æŽ¥å­˜æ¡£æ•°æ®
    //traverse( tables,Elements.ArchiveRow,row ){
    //   // å…ˆå¯»æ‰¾localRow,找不到就新建,并创建索引
    //   localRow := null( LocalRow );
    //   {
    //     localRowHandle := localRowIndexTree.GetHandle( row.Name() );
    //     localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
    //     if( isnull( localRowIndex )){
    //       localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() );
    //       localRows.Add( localRow );
    //       localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
    //     }else{
    //       localRow := localRows.Element( localRowIndex.GetValueAsNumber());
    //     }
    //   }
    //   // å¾ªçŽ¯åˆ›å»ºæœˆæ•°æ®
    //   traverse( localColumns,Elements,localColumn ){
    //      archiveCells := selectset( row,ArchiveCell.astype( ArchiveCell_ScheduleSummary ),cell,
    //                          cell.IsFristWeekData() and
    //                          cell.ArchiveColumn().CustomDate() >= localColumn.CustomDate() and
    //                          cell.ArchiveColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );
    //
    //      isFuture := macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate();
    //
    //      workingDay := 0;
    //      capacity := 0.0;
    //      output := 0.0;
    //      shiftPatterns := construct( Strings );
    //
    //      localCell := null( LocalCell_ScheduleSummary );
    //      {
    //        localCellHandle := localCellIndexTree.GetHandle( row.Name() + localColumn.CustomDate().AsQUILL() );
    //        localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue ));
    //        if( isnull( localCellIndex )){
    //          localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn );
    //          localCells.Add( localCell );
    //          localCellIndexTree.Root().AddChild( localCellHandle , localCells.Size() - 1 );
    //        }else{
    //          localCell := localCells.Element( localCellIndex.GetValueAsNumber() );
    //        }
    //      }
    //
    //      traverse( archiveCells,Elements,cell,cell.IsFristWeekData() ){
    //         workingDay := workingDay + cell.WorkingDay();
    //         capacity := capacity + cell.Capacity();
    //         if( cell.ShiftPattern() <> "" ){
    //           shiftPatterns.Add( cell.ShiftPattern() );
    //         }
    //      }
    //
    //      localCell.ShiftPattern( selectuniquevalues( shiftPatterns,Elements,element,element ).Concatenate( "/" ) );
    //      localCell.WorkingDay( localCell.WorkingDay() + workingDay );
    //      localCell.Capacity( localCell.Capacity() + capacity );
    //      localCell.Output( localCell.Output() + output );
    //   }
    //}
    tempArchiveTable := ArchiveCell_ScheduleSummary::CreateTempTable( macroPlan,recycleBin );
    traverse( tempArchiveTable,LocalRow,row ){
       localRow := null( LocalRow );
       {
         localRowHandle := localRowIndexTree.GetHandle( row.CustomName());
@@ -157,7 +99,8 @@
           localRow := localRows.Element( localRowIndex.GetValueAsNumber());
         }
       }
       traverse( localColumns,Elements,localColumn ){
       // å¾ªçŽ¯æ—¶é—´ä¸ºè®¡åˆ’å¼€å§‹æ—¥æœŸä¹‹åŽçš„æ—¶é—´
       traverse( localColumns,Elements,localColumn ,localColumn.CustomDate() >= macroPlan.StartOfPlanning().Date() or LocalTool::GetYYYYMM( localColumn.CustomDate() ) = LocalTool::GetYYYYMM( macroPlan.StartOfPlanning().Date() )){
          archiveCells := selectset( row,LocalCell.astype( LocalCell_ScheduleSummary ),cell,
                              cell.LocalColumn().CustomDate() >= localColumn.CustomDate() and 
                              cell.LocalColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );
@@ -179,22 +122,6 @@
                             newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().StartDate() < localColumn.CustomDate().StartOfNextMonth() and
                             newSupply.ProductInStockingPointInPeriodPlanning().Period_MP().TimeUnit() = "Day",
                             newSupply.Quantity());
            }
          }
          // è®¡åˆ’开始之前的产出取实际每日生产接口
          if( localColumn.CustomDate() < macroPlan.StartOfPlanning().Date() ){
            // å¼€å§‹æ—¶é—´å–比较小的开始时间
            historyStartDate := ifexpr( macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(), macroPlan.StartOfPlanning().Date(), localColumn.CustomDate() );
            // ç»“束时间取比较大的开始时间,如果和计划开始时间处于同一个月份,则取计划开始时间;否则取月底时间
            historyEndDate := ifexpr( macroPlan.StartOfPlanning().Date() > localColumn.CustomDate().StartOfNextMonth() and
                                      macroPlan.StartOfPlanning().Date().Month() = localColumn.CustomDate().Month() and
                                      macroPlan.StartOfPlanning().Date().Year() = localColumn.CustomDate().Year() ,macroPlan.StartOfPlanning().Date(), localColumn.CustomDate().StartOfNextMonth() );
            {
              actualOut := sum( archive,ActualDailyProductionData,data,data.LineName() = row.CustomName() and
                                data.ProductionDate() >= historyStartDate and
                                data.ProductionDate() < historyEndDate,data.ActualOut() );
              output := output + actualOut;
            }
          }
          
@@ -220,47 +147,67 @@
          }
          
          localCell.ShiftPattern( selectuniquevalues( shiftPatterns,Elements,element,element ).Concatenate( "/" ) );
          localCell.WorkingDay( localCell.WorkingDay() + workingDay );
          localCell.Capacity( localCell.Capacity() + capacity );
          localCell.Output( localCell.Output() + output );
       }
    }
    
    traverse( archive,ArchiveShiftPlanRow,row ){
    historyTempTable := ArchiveCell_ScheduleSummary::CreateHistoryTempTable( archive,recycleBin,macroPlan );
    traverse( historyTempTable,LocalRow,row ){
       localRow := null( LocalRow );
       {
         localRowHandle := localRowIndexTree.GetHandle( row.UnitID());
         localRowHandle := localRowIndexTree.GetHandle( row.CustomName());
         localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
         if( isnull( localRowIndex )){
           localRow := localTable.LocalRow( relnew,CustomName := row.UnitID(),Index := localTable.GetRowIndexCache() );
           localRow := localTable.LocalRow( relnew,CustomName := row.CustomName(),Index := localTable.GetRowIndexCache() );
           localRows.Add( localRow );
           localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
         }else{
           localRow := localRows.Element( localRowIndex.GetValueAsNumber());
         }
       }
       traverse( localColumns,Elements,localColumn ){
          archiveCells := selectset( row,ArchiveShiftPlanCell,cell,
                              cell.ArchiveShiftPlanColumn().StartDate() >= localColumn.CustomDate() and
                              cell.ArchiveShiftPlanColumn().StartDate() < localColumn.CustomDate().StartOfNextMonth() );
       // å¾ªçŽ¯æ—¶é—´ä¸ºè®¡åˆ’å¼€å§‹æ—¥æœŸä¹‹å‰çš„æ—¶é—´
       traverse( localColumns,Elements,localColumn , localColumn.CustomDate() < macroPlan.StartOfPlanning().Date() or LocalTool::GetYYYYMM( localColumn.CustomDate() ) = LocalTool::GetYYYYMM( macroPlan.StartOfPlanning().Date() )){
          archiveCells := selectset( row,LocalCell.astype( LocalCell_ScheduleSummary ),cell,
                              cell.LocalColumn().CustomDate() >= localColumn.CustomDate() and
                              cell.LocalColumn().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );
          
          workingDay := 0;
          capacity := 0.0;
          output := 0.0;
          shiftPatterns := construct( Strings );
          
          traverse( archiveCells,Elements,cell ){
             // capacity := capacity + cell.Capacity();
             if( cell.Outcome() <> "" ){
             if( cell.ShiftPattern() <> "" ){
               workingDay := workingDay + 1;
               shiftPatterns.Add( cell.Outcome() );
               capacity := capacity + cell.Capacity();
               shiftPatterns.Add( cell.ShiftPattern() );
             }
          }
          
          // è®¡åˆ’开始之前的产出取实际每日生产接口
          {
            // å¼€å§‹æ—¶é—´å–比较小的开始时间
            historyStartDate := ifexpr( macroPlan.StartOfPlanning().Date() <= localColumn.CustomDate(), macroPlan.StartOfPlanning().Date(), localColumn.CustomDate() );
            // ç»“束时间取比较大的开始时间,如果和计划开始时间处于同一个月份,则取计划开始时间;否则取月底时间
            historyEndDate := ifexpr( macroPlan.StartOfPlanning().Date() > localColumn.CustomDate().StartOfNextMonth() and
                                      macroPlan.StartOfPlanning().Date().Month() = localColumn.CustomDate().Month() and
                                      macroPlan.StartOfPlanning().Date().Year() = localColumn.CustomDate().Year() ,macroPlan.StartOfPlanning().Date(), localColumn.CustomDate().StartOfNextMonth() );
            {
              actualOut := sum( archive,ActualDailyProductionData,data,data.Fac() +" "+ data.LineName() = row.CustomName() and
                                data.ProductionDate() >= historyStartDate and
                                data.ProductionDate() < historyEndDate,data.ActualOut() );
              output := output + actualOut;
            }
          }
          
          localCell := null( LocalCell_ScheduleSummary );
          {
            localCellHandle := localCellIndexTree.GetHandle( row.UnitID() + localColumn.CustomDate().AsQUILL() );
            localCellHandle := localCellIndexTree.GetHandle( row.CustomName() + localColumn.CustomDate().AsQUILL() );
            localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue ));
            if( isnull( localCellIndex )){
              localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn );
@@ -272,9 +219,9 @@
          }
          
          localCell.ShiftPattern( selectuniquevalues( shiftPatterns,Elements,element,element ).Concatenate( "/" ) );
          localCell.WorkingDay( localCell.WorkingDay() + workingDay );
          localCell.Capacity( localCell.Capacity() + capacity );
          localCell.Output( localCell.Output() + output );
       }
    }
    
@@ -292,19 +239,19 @@
            scheduleSummaryOutputDataIndex := guard( scheduleSummaryOutputDataIndexTree.Root().Child( scheduleSummaryOutputDataHandle ),null( NamedValue ));
            if( not isnull( scheduleSummaryOutputDataIndex )){
              scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( scheduleSummaryOutputDataIndex.GetValueAsNumber() );
              if( scheduleSummaryOutputData.Output() <> -1 ){
              if( scheduleSummaryOutputData.Output() <> 0 ){
                output := scheduleSummaryOutputData.Output();
                cell.Output( output );
              }
              if( scheduleSummaryOutputData.WorkingDay() <> -1 ){
              if( scheduleSummaryOutputData.WorkingDay() <> 0 ){
                workingDay := scheduleSummaryOutputData.WorkingDay();
                cell.WorkingDay( workingDay );
              }
              if( scheduleSummaryOutputData.Capacity() <> -1 ){
              if( scheduleSummaryOutputData.Capacity() <> 0 ){
                capacity := scheduleSummaryOutputData.Capacity();
                cell.Capacity( capacity );
              }
              if( scheduleSummaryOutputData.ShiftPattern() <> "-1"){
              if( scheduleSummaryOutputData.ShiftPattern() <> "0"){
                shiftPattern := scheduleSummaryOutputData.ShiftPattern();
                cell.ShiftPattern( shiftPattern );
              }
_Main/BL/Type_MP_Cell_ScheduleSummary0/StaticMethod_CreateHistoryTempTable.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateHistoryTempTable (
  const Archive archive,
  RecycleBin recycleBin,
  const MacroPlan macroPlan
) as LocalTable
{
  TextBody:
  [*
    // rislai Aug-6-2024 (created)
    table := recycleBin.LocalTable( relnew,Name := ArchiveCell_ScheduleSummary::GetTableName());
    // èŽ·å–å¼€å§‹æ—¶é—´å’Œç»“æŸæ—¶é—´
    startDate := Date::Construct( Date::ActualDate().Year() - 1, 6, 1 );
    {
      minActualDailyProductionDataDate := guard( minselect( archive,ActualDailyProductionData,data,data.ProductionDate() ).ProductionDate(),Date::MaxDate() );
      minArchiveShiftPlanDate := guard( minselect( archive,ArchiveShiftPlanColumn,data,data.StartDate()).StartDate(),Date::MaxDate() );
      if( minActualDailyProductionDataDate <> Date::MaxDate() or minArchiveShiftPlanDate <> Date::MaxDate() ){
        if( minArchiveShiftPlanDate > minActualDailyProductionDataDate ){
          startDate := minActualDailyProductionDataDate;
        }else {
          startDate := minArchiveShiftPlanDate;
        }
      }
    }
    endDate := macroPlan.StartOfPlanning().Date();
    // èŽ·å–å®žé™…ç”Ÿäº§æ•°æ®
    actualDailyProductionDataIndexTree := NamedValueTree::Create();
    actualDailyProductionDatas := selectset( archive,ActualDailyProductionData,data, data.ProductionDate() <= endDate );
    //                                         exists( tables,Elements.ArchiveRow,row,row.CustomName() = data.LineName() ));
    // æž„建实际生产数据索引
    for( i :=0;i < actualDailyProductionDatas.Size();i++ ){
      actualDailyProductionData := actualDailyProductionDatas.Element( i );
      actualDailyProductionDataKey := actualDailyProductionData.LineName() + actualDailyProductionData.ProductionDate().AsQUILL();
      actualDailyProductionDataHandle := actualDailyProductionDataIndexTree.GetHandle( actualDailyProductionDataKey );
      actualDailyProductionDataIndexTree.Root().AddChild( actualDailyProductionDataHandle,i );
    }
    // unit的索引
    units := selectset( macroPlan,Unit,unit,unit.HasCapacityTypeTime() and not unit.HasChild());
    unitIndexTree := NamedValueTree::Create();
    for( i := 0 ; i< units.Size() ; i++ ){
      unit := units.Element( i );
      unitHandle := unitIndexTree.GetHandle( unit.ID() );
      unitIndexTree.Root().AddChild( unitHandle,i );
    }
    columns := construct( LocalColumns );
    columnIndexTree := NamedValueTree::Create();
    for( i := startDate;i < endDate; i := i + 1){
      column := table.LocalColumn( relnew,CustomDate := i );
      columnHandle := columnIndexTree.GetHandle( i.AsQUILL() );
      columns.Add( column );
      columnIndexTree.Root().AddChild( columnHandle,columns.Size() - 1 );
    }
    // è¿‡åŽ»çš„ç‰ˆæœ¬ï¼Œç­æ¬¡ï¼Œå·¥ä½œæ—¥å–å­˜æ¡£ArchiveShiftPlan,产出取ActualDailyProductionData,产能取班次时间*当前版本的节拍
    traverse( archive,ArchiveShiftPlanRow,archiveShiftPlanRow ){
      // unit.AsEntity().DisplayNameForSelection()
      row := table.LocalRow( relnew,CustomName := archiveShiftPlanRow.UnitID(),Index := table.GetRowIndexCache() );
      unit := constnull( Unit );
      {
        unitHandle := unitIndexTree.GetHandle( row.CustomName() );
        unitIndex := guard( unitIndexTree.Root().Child( unitHandle ),null( NamedValue ));
        if( not isnull( unitIndex )){
          unit := units.Element( unitIndex.GetValueAsNumber() );
        }
      }
      throughput := guard( sum( unit,Operation,operation,operation.Throughput() ) / unit.Operation( relsize ) , 0 );
      archiveShiftPlanCells := selectset( archiveShiftPlanRow,ArchiveShiftPlanCell,cell,
                                        cell.ArchiveShiftPlanColumn().StartDate() >= startDate
                                    and cell.ArchiveShiftPlanColumn().StartDate() < endDate );
      traverse( archiveShiftPlanCells,Elements,archiveShiftPlanCell ){
        columnHandle := columnIndexTree.GetHandle( archiveShiftPlanCell.ArchiveShiftPlanColumn().StartDate().AsQUILL() );
        columnIndex := guard( columnIndexTree.Root().Child( columnHandle ),null( NamedValue ));
        if( not isnull( columnIndex )){
          workDay := ifexpr( archiveShiftPlanCell.Outcome() <> "",1,0 );
          column := columns.Element( columnIndex.GetValueAsNumber() );
          capacity := 0.0;
          capacity := ShiftPlan::GetWorkHoursByShiftPatternName( archiveShiftPlanCell.Outcome() ) * throughput //* workHours.Capacity().HoursAsReal()
          row.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := column,
                       ShiftPattern := archiveShiftPlanCell.Outcome(),
                       WorkingDay := workDay,
                       Capacity := capacity,
                       Output := 0 );
        }
      }
    }
    traverse( table,LocalColumn,column,column.LocalCell( relsize ) = 0 ){
      column.Delete();
    }
    return table;
  *]
}
_Main/BL/Type_ShiftPlan/StaticMethod_GetWorkHoursByShiftPatternName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetWorkHoursByShiftPatternName (
  String shiftPatternName
) const declarative as Real
{
  TextBody:
  [*
    // Akari Sep-6-2024 (created)
    result := 0.0;
    if( shiftPatternName = "1" ){
      result := 8.0;
    }else if( shiftPatternName = "2" ){
      result := 16.0;
    }else if(shiftPatternName = "9+9"){
      result := 18.0;
    }else if(shiftPatternName = "10+10"){
      result := 20.0;
    }else if(shiftPatternName = "11+11"){
      result := 22.0;
    }else if(shiftPatternName = "1(9)" or shiftPatternName = "1(9)"){
      result := 9.0;
    }else if(shiftPatternName = "1(10)" or shiftPatternName = "1(10)"){
      result := 10.0;
    }else if(shiftPatternName = "3"){
      result := 22.5;
    }
    return result;
  *]
}