From 8f6703cb76e33583bba780bffe8eb440e64c474a Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期四, 10 十月 2024 11:17:45 +0800
Subject: [PATCH] 拆分单班次
---
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl | 35 ++++++++++-------
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl | 30 +++++++++++++++
2 files changed, 51 insertions(+), 14 deletions(-)
diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl
index 6d686a2..2f98a27 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl
+++ b/_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() );
}
}
}
diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl
new file mode 100644
index 0000000..da1f73a
--- /dev/null
+++ b/_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;
+ *]
+}
--
Gitblit v1.9.3