xiaoding721
2024-10-18 6d9968b5e3de0f425bef89103b9d4eec06a897f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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( "白班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
      
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftSchedulingInformation2.SingleShiftName( "二班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation2 );
      
      shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftSchedulingInformation3.SingleShiftName( "三班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation3 );
    }else if( shiftName = "2" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 );
      shiftSchedulingInformation1.SingleShiftName( "白班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
      
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 );
      shiftSchedulingInformation2.SingleShiftName( "二班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation2 );
    }else if( shiftName = "1" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 );
      shiftSchedulingInformation1.SingleShiftName( "白班" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
    }else{
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 );
      shiftSchedulingInformation1.SingleShiftName( "" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
    }
    
    
    return &shiftSchedulingInformations;
  *]
}