From 9eb69f8e68fbaea2f6becc92d3b84236084ab04b Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期二, 15 十月 2024 02:10:43 +0800
Subject: [PATCH] 修改批量修改shift pattern功能

---
 _Main/BL/Type_LocalTool/StaticMethod_BatchSetUnitShiftPattern.qbl |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/_Main/BL/Type_LocalTool/StaticMethod_BatchSetUnitShiftPattern.qbl b/_Main/BL/Type_LocalTool/StaticMethod_BatchSetUnitShiftPattern.qbl
index 7b369a3..31bd0a7 100644
--- a/_Main/BL/Type_LocalTool/StaticMethod_BatchSetUnitShiftPattern.qbl
+++ b/_Main/BL/Type_LocalTool/StaticMethod_BatchSetUnitShiftPattern.qbl
@@ -13,6 +13,31 @@
   [*
     // Akari Oct-10-2024 (created)
     owner := unit.MacroPlan();
+    
+    saveDays := construct( Dates );
+    flag := startDate.StartOfNextWeek();
+    for( i := startDate; i<endDate; i := i + 1 ){
+      if( i < flag ){
+        saveDays.Add( i ); 
+      }else{
+        temp := skipWeek - 1;
+        while( temp > 0 ){
+          i := flag;
+          flag := i.StartOfNextWeek();
+          temp--;
+          
+          info( i.Format( "Y-M2-D2") );
+          info( flag.Format( "Y-M2-D2") );
+        }
+      }
+    }
+    
+    info( "----------------------------");
+    
+    traverse( saveDays,Elements,element ){
+      info( element.Format( "Y-M2-D2")); 
+    }
+    
     dayPeriod_MPs := selectsortedset( owner,Period_MP,period_MP, 
                                       period_MP.TimeUnit() = 'Day' and 
                                       period_MP.StartDate() >= startDate and 
@@ -22,6 +47,7 @@
                                        period_MP.StartDate() >= startDate and 
                                        period_MP.EndDate() <= endDate and exists( weekdays, Elements,dayOfWeek,dayOfWeek = period_MP.StartDate().DayOfWeek() ),period_MP.StartDate());
     
+    
     if( dayPeriod_MPs.Size() > 0 ){
       unitPeriodTimes := selectset( unit,UnitPeriod.astype( UnitPeriodTime ),unitPeriodTime,exists( dayPeriod_MPs,Elements,period_MP,period_MP = unitPeriodTime.Period_MP()));
       if( unitPeriodTimes.Size() > 0 ){

--
Gitblit v1.9.3