xiaoding721
2024-10-25 d5c074b9e2daa5030a8e730a30d2ed31c8169e7d
修复一些bug
已修改4个文件
已添加2个文件
124 ■■■■■ 文件已修改
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Component_ListData.def 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Component_PanelData.def 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Response_PanelData_dhCheckUnits_OnDataChanged.def 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Response_PanelData_dhFinalUnits_OnCreated.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_Dispatch.qbl
@@ -30,6 +30,20 @@
      unitIndexTree.Root().AddChild( unitHandle,i );
    }
    
    // productLines := selectuniquevalues( offlinePlan,NewOfflinePlanRow,row,row.ProductionLine() );
    productLinesQuantityNameValueTree := NamedValueTree::Create();
    traverse( offlinePlan,NewOfflinePlanRow,row ){
      traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
        productLinesQuantityHandle := productLinesQuantityNameValueTree.GetHandle( row.ProductionLine() + cell.NewOfflinePlanColumn().StartDate().AsQUILL() );
        productLinesQuantity := guard( productLinesQuantityNameValueTree.Root().Child( productLinesQuantityHandle ),null( NamedValue ));
        if( not isnull( productLinesQuantity )){
          productLinesQuantity.SetValue( productLinesQuantity.GetValueAsReal() + cell.Quantity() );
        }else{
          productLinesQuantityNameValueTree.Root().AddChild( productLinesQuantityHandle, cell.Quantity() );
        }
      }
    }
    traverse( offlinePlan,NewOfflinePlanRow,row ){
      productID := row.ProductID();
      productLine := row.ProductionLine();
@@ -48,7 +62,10 @@
          factory := temp2;
        }
      }
      traverse( row,NewOfflinePlanCell,cell ,startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
      traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
        productLinesQuantityHandle := productLinesQuantityNameValueTree.GetHandle( row.ProductionLine() + cell.NewOfflinePlanColumn().StartDate().AsQUILL() );
        productLinesQuantity := guard( productLinesQuantityNameValueTree.Root().Child( productLinesQuantityHandle ).GetValueAsReal(),0.0 );
        shiftDate := cell.NewOfflinePlanColumn().StartDate();
        shiftName := cell.ShiftPatternName();
        shiftVolume := cell.Quantity();
@@ -62,7 +79,7 @@
          }
        }
        if( shiftVolume <> 0 ){
          shiftSchedulingInformations := DispatchShiftSchedulingInformation::SplitShifts( owner,shiftName,shiftVolume );
          shiftSchedulingInformations := DispatchShiftSchedulingInformation::SplitShifts( owner,shiftName,shiftVolume,productLinesQuantity );
        
        traverse( shiftSchedulingInformations,Elements,shiftSchedulingInformation ){
          shiftSchedulingInformation.InterfaceTime( now );
_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_SplitShifts.qbl
@@ -3,7 +3,8 @@
StaticMethod SplitShifts (
  RecycleBin owner,
  String shiftName,
  Real shiftVolume
  Real shiftVolume,
  Real productLinesQuantity
) as owning DispatchShiftSchedulingInformations
{
  TextBody:
@@ -11,31 +12,41 @@
    // Akari Oct-9-2024 (created)
    shiftSchedulingInformations := construct( DispatchShiftSchedulingInformations );
    if( shiftName = "3" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftQuantity := productLinesQuantity / 3 ;
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) );
      shiftSchedulingInformation1.SingleShiftName( "鐧界彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
      
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftVolume := shiftVolume - shiftQuantity;
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) );
      shiftSchedulingInformation2.SingleShiftName( "浜岀彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation2 );
      
      shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 3 );
      shiftVolume := shiftVolume - shiftQuantity;
      shiftSchedulingInformation3 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) );
      shiftSchedulingInformation3.SingleShiftName( "涓夌彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation3 );
    }else if( shiftName = "2" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 );
      shiftQuantity := productLinesQuantity / 2 ;
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ));
      shiftSchedulingInformation1.SingleShiftName( "鐧界彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
      
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 2 );
      shiftVolume := shiftVolume - shiftQuantity;
      shiftSchedulingInformation2 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := ifexpr( shiftVolume >= shiftQuantity, shiftQuantity, shiftVolume ) );
      shiftSchedulingInformation2.SingleShiftName( "浜岀彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation2 );
    }else if( shiftName = "1" ){
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 );
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume );
      shiftSchedulingInformation1.SingleShiftName( "鐧界彮" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
    }else{
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume / 1 );
      shiftSchedulingInformation1 := owner.DispatchShiftSchedulingInformation( relnew ,ID := IDHolder::GetGUID(),ShiftName := shiftName,ShiftVolume := shiftVolume );
      shiftSchedulingInformation1.SingleShiftName( "" );
      shiftSchedulingInformations.Add( shiftSchedulingInformation1 );
    }
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Component_ListData.def
@@ -11,7 +11,9 @@
      BaseType: 'WebDataExtractor'
      Properties:
      [
        DataType: 'external[RecycleBin]'
        DataType: 'RecycleBin'
        FilterArguments: 'checkedUnits:QMacroPlanner::FormDispatchShiftSchedulingInformation.dhFinalUnits'
        FixedFilter: 'exists( checkedUnits,Elements,unit,unit.DisplayName() = object.ProductLine())'
        Source: 'RecycleBin'
        Taborder: 0
        Transformation: 'DispatchShiftSchedulingInformation'
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Component_PanelData.def
@@ -6,6 +6,41 @@
  Children:
  [
    #child: ListData
    Component dhFinalUnits
    {
      #keys: '[414996.1.167251230]'
      BaseType: 'WebDataHolder'
      Databinding: 'structured[Entity]*'
      Properties:
      [
        Taborder: 1
      ]
    }
    Component dhCheckUnits
    {
      #keys: '[414996.1.167251252]'
      BaseType: 'WebDataHolder'
      Databinding: 'structured[Entity]*'
      Children:
      [
        Component deCheckUnits
        {
          #keys: '[414996.1.167251253]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'structured[Entity]'
            Source: 'ApplicationMacroPlanner.DataHolderCheckedEntities'
            Taborder: 0
            Transformation: 'Elements'
          ]
        }
      ]
      Properties:
      [
        Taborder: 2
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Response_PanelData_dhCheckUnits_OnDataChanged.def
对比新文件
@@ -0,0 +1,21 @@
Quintiq file version 2.0
#parent: PanelData/dhCheckUnits
Response OnDataChanged () id:Response_PanelDemandComparison_634_dhCheckUnits_OnDataChanged
{
  #keys: '[414996.1.167251250]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnDataChanged'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      if( this.Data().Size() <> 0 ){
        units := selectset( dhFinalUnits.Data(),Elements,element,exists( this.Data(),Elements,entity,entity = element ));
        dhFinalUnits.Data( &units );
      }else{
        dhFinalUnits.Data( DataHolderEntities.Data().Copy() );
      }
    *]
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormDispatchShiftSchedulingInformation/Response_PanelData_dhFinalUnits_OnCreated.def
对比新文件
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: PanelData/dhFinalUnits
Response OnCreated () id:Response_PanelDemandComparison_634_dhFinalUnits_OnCreated
{
  #keys: '[414996.1.167251228]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      dhFinalUnits.Data( DataHolderEntities.Data().Copy() );
    *]
  }
}