| | |
| | | shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 ); |
| | | shiftSchedulingInformation3.SingleShiftName( "3ç" ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation3 ); |
| | | }else{ |
| | | shiftSchedulingInformation := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume ); |
| | | shiftSchedulingInformations.Add( shiftSchedulingInformation ); |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod BatchSetUnitShiftPattern ( |
| | | Unit unit, |
| | | ShiftPattern shiftPattern, |
| | | Date startDate, |
| | | Date endDate, |
| | | Numbers weekdays |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Akari Oct-10-2024 (created) |
| | | owner := unit.MacroPlan(); |
| | | dayPeriod_MPs := selectsortedset( owner,Period_MP,period_MP, |
| | | period_MP.TimeUnit() = 'Day' and |
| | | period_MP.StartDate() >= startDate and |
| | | period_MP.EndDate() <= endDate and exists( weekdays, Elements,dayOfWeek,dayOfWeek = period_MP.StartDate().DayOfWeek() ) ,period_MP.StartDate()); |
| | | weekPeriod_MPs := selectsortedset( owner,Period_MP,period_MP, |
| | | period_MP.TimeUnit() = 'Week' and |
| | | period_MP.StartDate() >= startDate and |
| | | period_MP.EndDate() <= endDate and exists( weekdays, Elements,dayOfWeek,dayOfWeek = period_MP.StartDate().DayOfWeek() ),period_MP.StartDate()); |
| | | traverse( dayPeriod_MPs ,Elements,element ){ |
| | | info( element.StartDate().DayOfWeek() ); |
| | | } |
| | | |
| | | if( dayPeriod_MPs.Size() > 0 ){ |
| | | unitPeriodTimes := selectset( unit,UnitPeriod.astype( UnitPeriodTime ),unitPeriodTime,exists( dayPeriod_MPs,Elements,period_MP,period_MP = unitPeriodTime.Period_MP()) and not isnull( unitPeriodTime.UnitAvailability())); |
| | | if( unitPeriodTimes.Size() > 0 ){ |
| | | LocalTool::SetUnitShiftPattern( owner,unitPeriodTimes,shiftPattern ); |
| | | } |
| | | |
| | | } |
| | | if( weekPeriod_MPs.Size() <> 0 ){ |
| | | traverse( weekPeriod_MPs,Elements,period_MP ){ |
| | | unitPeriodTimes := selectset( unit,UnitPeriod.astype( UnitPeriodTime ),unitPeriodTime,period_MP = unitPeriodTime.Period_MP() and not isnull( unitPeriodTime.UnitAvailability())); |
| | | if( unitPeriodTimes.Size() > 0 ){ |
| | | LocalTool::SetUnitShiftPattern( owner,unitPeriodTimes,shiftPattern ); |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod SetUnitShiftPattern ( |
| | | MacroPlan macroPlan, |
| | | UnitPeriodTimes unitPeriodTimes, |
| | | ShiftPattern shiftPattern |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Akari Oct-10-2024 (created) |
| | | firstElement := minselect( unitPeriodTimes, Elements, e, true, e.Start() ); |
| | | |
| | | start := macroPlan.Start(); |
| | | timeunit := macroPlan.StartOfPlanningPeriod().TimeUnit(); |
| | | maintenance := Duration::Zero(); |
| | | efficiency := 1.0; |
| | | allocation := 1.0; |
| | | |
| | | maxloadpercentage := macroPlan.GlobalParameters_MP().DefaultMaxLoadPercentage(); |
| | | nrofunitopen := 1; |
| | | minloadthreshold := 0.0; |
| | | |
| | | if( not isnull( firstElement ) ){ |
| | | // To inherit the value from last unit availability while creating a new unit availability |
| | | unitavailability := firstElement.UnitAvailability(); |
| | | start := firstElement.Start(); |
| | | |
| | | if( not isnull( unitavailability ) ){ |
| | | timeunit := unitavailability.TimeUnit(); |
| | | maintenance := unitavailability.Maintenance(); |
| | | efficiency := unitavailability.Efficiency(); |
| | | allocation := unitavailability.Allocation(); |
| | | |
| | | maxloadpercentage := unitavailability.MaximumLoadPercentage(); |
| | | nrofunitopen := unitavailability.NrOfUnitsOpen(); |
| | | minloadthreshold := unitavailability.MinimumLoadThreshold(); |
| | | }else{ |
| | | timeunit := firstElement.Period_MP().TimeUnit(); |
| | | maintenance := firstElement.Maintenance(); |
| | | efficiency := firstElement.Efficiency(); |
| | | allocation := firstElement.Allocation(); |
| | | |
| | | maxloadpercentage := firstElement.MaximumLoadPercentage(); |
| | | nrofunitopen := firstElement.NrOfOpen(); |
| | | minloadthreshold := firstElement.MinimumLoadThreshold(); |
| | | } |
| | | } |
| | | |
| | | isbatchedit := unitPeriodTimes.Size() > 1; |
| | | UnitAvailability::CreateOrUpdateForUnitPeriodTimes( unitPeriodTimes, |
| | | not isbatchedit or false, |
| | | timeunit, |
| | | maintenance, |
| | | not isbatchedit or false, |
| | | efficiency, |
| | | false, |
| | | allocation, |
| | | not isbatchedit or true, |
| | | shiftPattern, |
| | | not isbatchedit or false, |
| | | maxloadpercentage, |
| | | not isbatchedit or false, |
| | | nrofunitopen, |
| | | false, |
| | | not isbatchedit or false, |
| | | minloadthreshold |
| | | ); |
| | | *] |
| | | } |
| | |
| | | BaseType: 'WebPanel' |
| | | Children: |
| | | [ |
| | | Component cbMonday |
| | | { |
| | | #keys: '[414996.1.116589495]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component cbTuesday |
| | | { |
| | | #keys: '[414996.1.116589517]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | | Component cbWednesday |
| | | { |
| | | #keys: '[414996.1.116589519]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 5 |
| | | ] |
| | | } |
| | | Component cbThursday |
| | | { |
| | | #keys: '[414996.1.116589521]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 6 |
| | | ] |
| | | } |
| | | Component cbFriday |
| | | { |
| | | #keys: '[414996.1.116589523]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 7 |
| | | ] |
| | | } |
| | | Component cbSaturday |
| | | { |
| | | #keys: '[414996.1.116589525]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 8 |
| | | ] |
| | | } |
| | | Component cbSunday |
| | | { |
| | | #keys: '[414996.1.116589527]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Taborder: 9 |
| | | ] |
| | | } |
| | | Component dsStartDate |
| | | { |
| | | #keys: '[414996.1.116589712]' |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'Start' |
| | | Taborder: 1 |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component dsEndDate |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'End' |
| | | Taborder: 2 |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component LabelSelectUnit |
| | |
| | | Properties: |
| | | [ |
| | | Label: 'Apply' |
| | | Taborder: 11 |
| | | ] |
| | | } |
| | | Component ddlShiftPattern |
| | | { |
| | | #keys: '[414996.1.116430349]' |
| | | BaseType: 'WebDropDownList' |
| | | Databinding: 'ShiftPattern' |
| | | Children: |
| | | [ |
| | | Component deContent710 id:deContent710_593 |
| | | { |
| | | #keys: '[414996.1.116430350]' |
| | | BaseType: 'WebDataExtractor' |
| | | Properties: |
| | | [ |
| | | DataType: 'MacroPlan' |
| | | Source: 'MacroPlan' |
| | | Taborder: 0 |
| | | Transformation: 'ShiftPattern' |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | DisplayField: 'Name' |
| | | Label: 'Shift pattern 1' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | Component cbMonday |
| | | { |
| | | #keys: '[414996.1.117120493]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Monday' |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | | Component cbTuesday |
| | | { |
| | | #keys: '[414996.1.117120516]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Tuesday' |
| | | Taborder: 5 |
| | | ] |
| | | } |
| | | Component cbWednesday |
| | | { |
| | | #keys: '[414996.1.117120539]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Wednesday' |
| | | Taborder: 6 |
| | | ] |
| | | } |
| | | Component cbThursday |
| | | { |
| | | #keys: '[414996.1.117120576]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Thursday' |
| | | Taborder: 7 |
| | | ] |
| | | } |
| | | Component cbFriday |
| | | { |
| | | #keys: '[414996.1.117120599]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Friday' |
| | | Taborder: 8 |
| | | ] |
| | | } |
| | | Component cbSaturday id:cbSaturday_682 |
| | | { |
| | | #keys: '[414996.1.117120636]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Saturday' |
| | | Taborder: 9 |
| | | ] |
| | | } |
| | | Component cbSunday |
| | | { |
| | | #keys: '[414996.1.117120659]' |
| | | BaseType: 'WebCheckbox' |
| | | Properties: |
| | | [ |
| | | Label: 'Sunday' |
| | | Taborder: 10 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: PanelRight/bApply |
| | | Response OnClick () id:Response_PanelRight_bApply_OnClick |
| | | { |
| | | #keys: '[414996.1.117189721]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | GroupServerCalls: true |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | weekdays := construct( Numbers ); |
| | | if( cbMonday.Checked() ){ |
| | | weekdays.Add( 1 ); |
| | | } |
| | | if( cbTuesday.Checked() ){ |
| | | weekdays.Add( 2 ); |
| | | } |
| | | if( cbWednesday.Checked() ){ |
| | | weekdays.Add( 3 ); |
| | | } |
| | | if( cbThursday.Checked() ){ |
| | | weekdays.Add( 4 ); |
| | | } |
| | | if( cbFriday.Checked() ){ |
| | | weekdays.Add( 5 ); |
| | | } |
| | | if( cbSaturday.Checked() ){ |
| | | weekdays.Add( 6 ); |
| | | } |
| | | if( cbSunday.Checked() ){ |
| | | weekdays.Add( 7 ); |
| | | } |
| | | LocalTool::BatchSetUnitShiftPattern( dhSelectUnit.Data(),ddlShiftPattern.Data(),dsStartDate.Date(),dsEndDate.Date(),weekdays ); |
| | | WebMessageBox::Success( "Success"); |
| | | *] |
| | | } |
| | | } |