| | |
| | | StaticMethod SplitShifts ( |
| | | RecycleBin owner, |
| | | String shiftName, |
| | | Real shiftVolume |
| | | Real shiftVolume, |
| | | Real productLinesQuantity |
| | | ) 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 ); |
| | | shiftQuantity := productLinesQuantity / 3 ; |
| | | |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) ); |
| | | shiftSchedulingInformation1.SingleShiftName( "白班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation1 ); |
| | | |
| | | shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 ); |
| | | shiftVolume := shiftVolume - shiftQuantity; |
| | | |
| | | shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) ); |
| | | shiftSchedulingInformation2.SingleShiftName( "二班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation2 ); |
| | | |
| | | shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 ); |
| | | shiftVolume := shiftVolume - shiftQuantity; |
| | | |
| | | shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) ); |
| | | shiftSchedulingInformation3.SingleShiftName( "三班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation3 ); |
| | | }else if( shiftName = "2" ){ |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 ); |
| | | shiftQuantity := productLinesQuantity / 2 ; |
| | | |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume )); |
| | | shiftSchedulingInformation1.SingleShiftName( "白班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation1 ); |
| | | |
| | | shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 ); |
| | | shiftVolume := shiftVolume - shiftQuantity; |
| | | |
| | | shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) ); |
| | | shiftSchedulingInformation2.SingleShiftName( "二班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation2 ); |
| | | }else if( shiftName = "1" ){ |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 ); |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume ); |
| | | shiftSchedulingInformation1.SingleShiftName( "白班" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation1 ); |
| | | }else{ |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 ); |
| | | shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume ); |
| | | shiftSchedulingInformation1.SingleShiftName( "" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation1 ); |
| | | } |