xiaoding721
2024-10-10 8f6703cb76e33583bba780bffe8eb440e64c474a
拆分单班次
已修改1个文件
已添加1个文件
65 ■■■■ 文件已修改
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl
@@ -61,22 +61,29 @@
            shiftDayTime := select( shiftPattern,ShiftDayTime,object,true );
          }
        }
        if( shiftVolume <> 0 ){
          shiftSchedulingInformations := DispatchShiftSchedulingInformation::SplitShifts( owner,shiftName,shiftVolume );
        
        shiftSchedulingInformation := owner.DispatchShiftSchedulingInformation( relnew ,
                                                                                ID := IDHolder::GetGUID() ,
                                                                                InterfaceTime := now ,
                                                                                VersionName := macroPlan.MDSMacroPlan().Description(),
                                                                                Product := productID,
                                                                                ProductLine := productLine,
                                                                                ShiftDate := shiftDate,
                                                                                ShiftName := shiftName,
                                                                                ShiftVolume := shiftVolume );
        if( not isnull( shiftDayTime )){
          shiftSchedulingInformation.ShiftStartDate( shiftDayTime.StartDateTime() );
          shiftSchedulingInformation.ShiftEndDate( shiftDayTime.EndDateTIme() );
        traverse( shiftSchedulingInformations,Elements,shiftSchedulingInformation ){
          shiftSchedulingInformation.InterfaceTime( now );
          shiftSchedulingInformation.VersionName( macroPlan.MDSMacroPlan().Description() );
          shiftSchedulingInformation.Product( productID );
          shiftSchedulingInformation.ProductLine( productLine );
          shiftSchedulingInformation.ShiftDate( shiftDate );
    //      shiftSchedulingInformation.InterfaceTime( now );
    //      shiftSchedulingInformation.InterfaceTime( now );
    //      shiftSchedulingInformation.InterfaceTime( now );
    //      shiftSchedulingInformation.InterfaceTime( now );
          if( not isnull( shiftDayTime )){
            shiftSchedulingInformation.ShiftStartDate( shiftDayTime.StartDateTime() );
            shiftSchedulingInformation.ShiftEndDate( shiftDayTime.EndDateTIme() );
          }
          if( not isnull( factory )){
            shiftSchedulingInformation.FactoryName( factory.Name() );
          }
        }
        if( not isnull( factory )){
          shiftSchedulingInformation.FactoryName( factory.Name() );
        }
      }
    }
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SplitShifts (
  RecycleBin owner,
  String shiftName,
  Real shiftVolume
) as owning DispatchShiftSchedulingInformations
{
  TextBody:
  [*
    // Akari Oct-9-2024 (created)
    shiftSchedulingInformations := construct( DispatchShiftSchedulingInformations );
    if( shiftName = "3" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftSchedulingInformation1.SingleShiftName( "1班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftSchedulingInformation2.SingleShiftName( "2班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation2 );
      shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftSchedulingInformation3.SingleShiftName( "3班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation3 );
    }
    return &shiftSchedulingInformations;
  *]
}