From 887dd485907fb75b76465de86dff57eeccd9fb04 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 23 七月 2024 16:43:58 +0800
Subject: [PATCH] 批量维护产能占用事件选择日期修改

---
 _Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/_Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl b/_Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl
index 76e31f8..55d6ee0 100644
--- a/_Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl
+++ b/_Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl
@@ -45,9 +45,15 @@
     //      , patternDaily_IsEveryWeekday_i, periodType_i, periodStartDate_i, nrOfOccurrences_i, periodEndDate_i );
     //鏌ヨ鏄惁宸叉湁鍚屽悕浜嬩欢
     event := selectobject( owner_i, Event, event, event.Subject() = subject_i 
-                     and event.StartTimeOfDay() = startTimeOfDay_i 
-                     and event.EndTimeOfDay() = endTimeOfDay_i 
-                     and event.EventType() = eventtype_i );
+                           and event.EventType() = eventtype_i
+                           and ( event.LeadingParticipation().EndDate() - event.LeadingParticipation().StartDate() ) = ( endDate_i - startDate_i )
+                           and event.StartTimeOfDay() = startTimeOfDay_i 
+                           and event.EndTimeOfDay() = endTimeOfDay_i );
+    //event := selectobject( owner_i, Event.LeadingParticipation, lp, lp.Event().Subject() = subject_i 
+    //                       and lp.Event().EventType() = eventtype_i
+    //                       and ( lp.EndDate() - lp.StartDate() ) = ( endDate_i - startDate_i )
+    //                       and lp.Event().StartTimeOfDay() = startTimeOfDay_i 
+    //                       and lp.Event().EndTimeOfDay() = endTimeOfDay_i );
     //鍙湁閫氳繃鎵归噺鍒涘缓鐣岄潰涓斿凡鏈夊悓鍚嶄簨浠惰繘鍏ヤ笅闈㈡搷浣�
     if( ismultiple and not isnull( event ) ){
       startdate := startDate_i;
@@ -69,7 +75,7 @@
       //淇敼鏃т簨浠剁殑闂撮殧
       nrOfOccurrences_i := enddate - startdate + 1;
       startDate_i := startdate;
-      endDate_i   := startdate;
+      endDate_i := ( event.LeadingParticipation().EndDate() - event.LeadingParticipation().StartDate() + startDate_i );
       periodStartDate_i := startdate;
       periodEndDate_i := enddate;
     //  info( startDate_i, startTimeOfDay_i, endDate_i, endTimeOfDay_i, isAllDay_i, recurrenceInterval_i, patternType_i
@@ -102,7 +108,9 @@
     if( not isnull( event ) ){
       event.EventType( relset, eventtype_i );
     }
-    
+    if( ismultiple ){
+      event.IsMultiple( ismultiple );
+    }
     return event;
   *]
 }

--
Gitblit v1.9.3