lazhen
2024-07-23 887dd485907fb75b76465de86dff57eeccd9fb04
批量维护产能占用事件选择日期修改
已添加2个文件
已修改9个文件
116 ■■■■ 文件已修改
_Main/BL/Type_LibCal_Event/Attribute_IsMultiple.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_Event/StaticMethod_CreateUpdateFromUI.qbl 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Component_pnlEventType.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Method_CreateEvent#791.def 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Method_EditEvent.def 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Component_ListList.def 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Component_PanelHeader#144.def 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_CreateEvent#778.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_CreateUpdateEventAndParticipation.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_SetParticipationData.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Response_PanelHeader_144_dsEndDate_OnChanged.def 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LibCal_Event/Attribute_IsMultiple.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsMultiple
{
  #keys: '3[415136.0.918010824][415136.0.918010823][415136.0.918010825]'
  Description: '是否通过批量界面创建'
  ValueType: Boolean
}
_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;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Component_pnlEventType.def
@@ -61,5 +61,6 @@
  [
    Orientation: 'horizontal'
    Taborder: 4
    Visible: false
  ]
}
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Method_CreateEvent#791.def
@@ -29,6 +29,13 @@
    {
      sEvent.Type( LibCal_Event::TYPE_PARTIAL() );
    }
    if( guard( category_i.Name() = LibCal_Event::TYPE_UNAVAILABLE(), false ) )
    {
      pnlEventType.Visible( true );
    }else
    {
      pnlEventType.Visible( false );
    }
    
    // Set the Event and the related controls...
    // The values are explicitly assigned here 'at the beginning' to the controls,
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgEvent/Method_EditEvent.def
@@ -29,7 +29,13 @@
    this.InitializeEventTypes();
    // Must be done here, when done in the OnCreated() the checkmarks are not always set.
    this.InitializeSubscribers();
    if( guard( sEvent.EventCategory().Name() = LibCal_Event::TYPE_UNAVAILABLE(), false ) )
    {
      pnlEventType.Visible( true );
    }else
    {
      pnlEventType.Visible( false );
    }
    // Open the dialog.
    this.Show( "modal" );
  *]
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Component_ListList.def
@@ -12,7 +12,7 @@
      Properties:
      [
        DataType: 'LibCal_EventCategory'
        FixedFilter: "object.Participation().Calendar().CalendarID() <> 'Common Calendar'"
        FixedFilter: "object.Participation().Calendar().CalendarID() <> 'Common Calendar' and object.Participation().Event().IsMultiple()"
        Source: 'dhCategory'
        Taborder: 0
        Transformation: 'Event.Participation.ExplicitTimeInterval'
@@ -29,7 +29,7 @@
      ]
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Calendar.CalendarID","title":"产线","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Calendar.CalendarID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.EventType.Name","title":"事件类型","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.EventType.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.Subject","title":"事件","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.Subject"}},{"attribute":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"StartDate","title":"日期","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.Start().Date()"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.StartTimeOfDay","title":"开始时间","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.StartTimeOfDay"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.EndTimeOfDay","title":"结束时间","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.EndTimeOfDay"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.Description","title":"备注","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.Description"}}]'
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Calendar.CalendarID","title":"产线","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Calendar.CalendarID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.EventType.Name","title":"事件类型","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.EventType.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.Subject","title":"事件","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.Subject"}},{"attribute":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"StartDate","title":"开始日期","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.Start().Date()"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.StartTimeOfDay","title":"开始时间","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.StartTimeOfDay"}},{"attribute":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"结束日期","title":"结束日期","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.End().Date()"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.EndTimeOfDay","title":"结束时间","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.EndTimeOfDay"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Participation.Event.Description","title":"备注","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Participation.Event.Description"}}]'
        ContextMenu: 'listContextMenu967'
        SortCriteria: 'desc:Start'
        Taborder: 2
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Component_PanelHeader#144.def
@@ -28,6 +28,7 @@
        Label: '开始日期'
        MaxDuration: P0DT23H59M0S
        MinDuration: P0DT0H0M0S
        ShowLabel: false
        Taborder: 8
      ]
    }
@@ -52,7 +53,8 @@
        Label: '结束日期'
        MaxDuration: P0DT23H59M0S
        MinDuration: P0DT0H0M0S
        Taborder: 10
        ShowLabel: false
        Taborder: 12
      ]
    }
    Component dhEndTimeOfDay
@@ -62,7 +64,7 @@
      Databinding: 'Duration'
      Properties:
      [
        Taborder: 11
        Taborder: 13
      ]
    }
    Component edtDescription
@@ -77,7 +79,7 @@
        Multiline: true
        NumberOfColumns: 29
        ShowLabel: false
        Taborder: 13
        Taborder: 15
      ]
    }
    Component dsStartDate
@@ -87,7 +89,7 @@
      Properties:
      [
        DateFormat: 'DMMY'
        Label: '日期'
        Label: '开始日期'
        Taborder: 6
      ]
    }
@@ -109,7 +111,7 @@
      [
        Label: '备注'
        NumberOfColumns: 0
        Taborder: 12
        Taborder: 14
      ]
    }
    Component ButtonCreate
@@ -119,7 +121,7 @@
      Properties:
      [
        Label: '新增'
        Taborder: 14
        Taborder: 16
      ]
    }
    Component ddslType id:ddslType_360
@@ -205,6 +207,27 @@
        Taborder: 3
      ]
    }
    Component dsEndDate
    {
      #keys: '[415136.0.923680588]'
      BaseType: 'WebDateSelector'
      Properties:
      [
        DateFormat: 'DMMY'
        Label: '结束日期'
        Taborder: 10
      ]
    }
    Component dhEndDate
    {
      #keys: '[415136.0.923671132]'
      BaseType: 'WebDataHolder'
      Databinding: 'Date'
      Properties:
      [
        Taborder: 11
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_CreateEvent#778.def
@@ -48,7 +48,7 @@
    // Set the Participation and the related controls
    // (only the DataHolders, the Date-controls are set later on, after the recurrence has been initialized)
    dhStartDate.Data( sLeadPart.StartDate() );
    //dhEndDate.Data(   sLeadPart.EndDate()   );
    dhEndDate.Data(   sLeadPart.EndDate()   );
    dhLeadingParticipation.Data( &sLeadPart );
    dhCategory.Data(category_i);
    //info( '-----------------------', isnull( dhLeadingParticipation.Data() ) );
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_CreateUpdateEventAndParticipation.def
@@ -18,7 +18,7 @@
    isDefault      := ckbApplyToNewResources.Checked();
    startDate      := dsStartDate.Date();
    startTimeOfDay := durStartTimeOfDay.Duration();
    endDate        := dsStartDate.Date();
    endDate        := dsEndDate.Date();
    endTimeOfDay   := durEndTimeOfDay.Duration();
    isAllDay       := false;
    
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Method_SetParticipationData.def
@@ -23,6 +23,7 @@
    // the value of the other controls are then set via the responses of these controls.
    //dhEndDate  .Data( sParticipation.EndDate() + delta );
    dsStartDate.Date( startDate );
    dsEndDate.Date( startDate );
    
    // Directly initialize the Duration
    //this.InitializeDuration();
_Main/UI/MacroPlannerWebApp/Component_LibCal_dlgMultipleEvent/Response_PanelHeader_144_dsEndDate_OnChanged.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
Quintiq file version 2.0
#parent: PanelHeader_144/dsEndDate
Response OnChanged () id:Response_PanelHeader_144_dsEndDate_OnChanged
{
  #keys: '[415136.0.923680587]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebDateTimeFieldBase_OnChanged'
  QuillAction
  {
    Body:
    [*
      // Adjust the EndDate accordingly.
      //if( dhStartDate.Data().IsFinite() )
      //{
      //  // Use the EndDate of the instance if the value of the control has not been set yet.
      //  endDate := ifexpr( dsEndDate.Date().IsFinite(), dsEndDate.Date(), dhLeadingParticipation.Data().EndDate() );
      //
      //  delta := this.Date() - dhStartDate.Data();
      //  dsEndDate.Date( endDate + delta );
      //}
      // Update the 'memory' for later delta-calculation, and/or setting the time back when AllDay is turned off.
      dhEndDate.Data( this.Date() );
      // Also set StartOfPeriod (always, also in case of a non-recurring event).
      //dsStartOfPeriod.Date( this.Date() );
    *]
    GroupServerCalls: false
  }
}