xiaoding721
2023-11-08 607205fa87d2b6084ad7cd545dffe68fd2009862
Merge branch 'dev' into dev_lrs
已添加8个文件
已删除2个文件
426 ■■■■■ 文件已修改
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes_DEBUG.qbl 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFGCrossBusiness.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFGCrossBusiness.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMCountCrossBusiness.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMIDs.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMIDsCrossBusiness.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFGCrossBusiness.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG.qbl 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl
文件已删除
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes_DEBUG.qbl
对比新文件
@@ -0,0 +1,75 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes_DEBUG
{
  Description: 'Method to traverse the supply chain to determine if there are any products that are not used to produce finished goods.'
  TextBody:
  [*
    // Reset IsLinkedWithFinishedGood
    traverse( this, Global_MappingProduct_MP, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
      instance.BOMCount( 0 );
      instance.BOMIDs( "" );
      instance.IsLinkedWithFGCrossBusiness( false );
      instance.BOMCountCrossBusiness( 0 );
      instance.BOMIDsCrossBusiness( "" );
    }
    traverse( this, Global_MappingOperation, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
      instance.IsLinkedWithFGCrossBusiness( false );
    }
    traverse( this, Global_MappingOperationBOM, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
      instance.IsLinkedWithFGCrossBusiness( false );
    }
    finishedgoods := selectset( this, Global_MappingProduct_MP, product,
                                product.ProductMajorType() = "鎴愬搧" );
    numfinishedgoods := finishedgoods.Size();
    index := 1;
    // Traverse each finished good and search for linked products/operations/lanes
    traverse( finishedgoods, Elements, product )
    {
      if( not product.IsLinkedWithFinishedGood() )
      {
        info( "KKK", this.DefinitionName(), "SetIsLinkedWithFinishedGoodAttributes",
              "| Processing Product:", product.ID(), "(", index, "/", numfinishedgoods, ")" );
        uniquebomids := construct( Strings );
        product.SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG( 0, // depth
                                                                 100, // maxdepth
                                                                 uniquebomids,
                                                                 false // isallowcrossbusinesstype
                                                               );
        uniquebomids := uniquebomids.Difference( product.ID() ).Unique();
        product.BOMCount( uniquebomids.Size() );
        product.BOMIDs( uniquebomids.ToString( ";" ) );
      }
      if( not product.IsLinkedWithFGCrossBusiness() )
      {
        info( "KKK", this.DefinitionName(), "SetIsLinkedWithFinishedGoodAttributes",
              "| Processing Product (cross business type):", product.ID(), "(", index, "/", numfinishedgoods, ")" );
        uniquebomidscrossbusiness := construct( Strings );
        product.SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG( 0, // depth
                                                                 100, // maxdepth
                                                                 uniquebomidscrossbusiness,
                                                                 true // isallowcrossbusinesstype
                                                               );
        uniquebomidscrossbusiness := uniquebomidscrossbusiness.Difference( product.ID() ).Unique();
        product.BOMCountCrossBusiness( uniquebomidscrossbusiness.Size() );
        product.BOMIDsCrossBusiness( uniquebomidscrossbusiness.ToString( ";" ) );
      }
      index++;
    }
    info( "KKK", this.DefinitionName(), "SetIsLinkedWithFinishedGoodAttributes", "| Ended." );
  *]
}
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFGCrossBusiness.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFGCrossBusiness
{
  #keys: '3[157968.0.1171600004][157968.0.1171600003][157968.0.1171600005]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good cross business type.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFGCrossBusiness.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFGCrossBusiness
{
  #keys: '3[157968.0.1171600022][157968.0.1171600021][157968.0.1171600023]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good cross business type.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMCountCrossBusiness.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute BOMCountCrossBusiness
{
  #keys: '3[157968.0.1171600059][157968.0.1171600058][157968.0.1171600060]'
  Description: 'Number of unique BOM used to produce this finished good cross business types.'
  ValueType: Number
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMIDs.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute BOMIDs
{
  #keys: '3[157968.0.1171600062][157968.0.1171600061][157968.0.1171600063]'
  Description: 'Unique BOM IDs used to produce this finished good.'
  ValueType: String
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_BOMIDsCrossBusiness.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute BOMIDsCrossBusiness
{
  #keys: '3[157968.0.1171600056][157968.0.1171600055][157968.0.1171600057]'
  Description: 'Unique BOM IDs used to produce this finished good cross business types.'
  ValueType: String
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFGCrossBusiness.qbl
对比新文件
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFGCrossBusiness
{
  #keys: '3[157968.0.1171600039][157968.0.1171600038][157968.0.1171600040]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good cross business type.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl
文件已删除
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG.qbl
对比新文件
@@ -0,0 +1,167 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG (
  Number depth,
  Number maxdepth,
  output Strings uniquebomids_o,
  Boolean isallowcrossbusinesstype
)
{
  Description: 'Method to traverse the supply chain recursively to determine if there are any products that are not used to produce finished goods.'
  TextBody:
  [*
    info( 'KKK2', this.DefinitionName(), "SetIsLinkedWithFinishedGoodAttributes_Recursive",
          "| Depth:", depth,
          "| Product:", this.ID(),
          "| BusinessType:", this.BusinessType(),
          "| isallowcrossbusinesstype:", isallowcrossbusinesstype,
          "| IsLinkedWithFGCrossBusiness:", this.IsLinkedWithFGCrossBusiness(),
          "| IsLinkedWithFinishedGood:", this.IsLinkedWithFinishedGood() );
    if( ifexpr( isallowcrossbusinesstype,
                not this.IsLinkedWithFGCrossBusiness(),
                not this.IsLinkedWithFinishedGood() ) )
    {
      depthlocal := depth + 1;
      if( uniquebomids_o.Find( this.ID() ) < 0 )
      {
        uniquebomids_o.Add( this.ID() );
      }
      if( isallowcrossbusinesstype )
      {
        this.IsLinkedWithFGCrossBusiness( true );
      }
      else
      {
        this.IsLinkedWithFinishedGood( true );
      }
      if( depthlocal <= maxdepth )
      {
        uniquebomids_local := construct( Strings );
        operations := selectset( this.GlobalOTDTable(), Global_MappingOperation, operation,
                                 ( isallowcrossbusinesstype
                                   or operation.BusinessType() = this.BusinessType() )
                                 and operation.ProductID() = this.ID() );
        traverse( operations, Elements, operation )
        {
          if( isallowcrossbusinesstype )
          {
            operation.IsLinkedWithFGCrossBusiness( true );
          }
          else
          {
            operation.IsLinkedWithFinishedGood( true );
          }
          operationboms := selectset( this.GlobalOTDTable(), Global_MappingOperationBOM, operationbom,
                                      operationbom.BusinessType() = operation.BusinessType()
                                      and operationbom.OrganCode() = operation.OrganCode()
                                      and operationbom.ProcessSection() = operation.ProcessSection()
                                      and operationbom.ProductCode() = operation.ProductID() );
          traverse( operationboms, Elements, operationbom )
          {
            if( isallowcrossbusinesstype )
            {
              operationbom.IsLinkedWithFGCrossBusiness( true );
            }
            else
            {
              operationbom.IsLinkedWithFinishedGood( true );
            }
            traverse( this.GlobalOTDTable(), Global_MappingProduct_MP, componentproduct,
                      componentproduct.ID() = operationbom.ComponentCode()
                      and ( isallowcrossbusinesstype
                            or componentproduct.BusinessType() = operationbom.BusinessType() ) )
            {
              componentproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG( depthlocal,
                                                                                maxdepth,
                                                                                uniquebomids_local,
                                                                                isallowcrossbusinesstype );
            }
            if( operationbom.AlternativeMaterialCode() <> ""
                and operationbom.AlternativeMaterialCode() <> operationbom.ComponentCode() )
            {
              traverse( this.GlobalOTDTable(), Global_MappingProduct_MP, alternativeproduct,
                        alternativeproduct.ID() = operationbom.AlternativeMaterialCode()
                        and ( isallowcrossbusinesstype
                              or alternativeproduct.BusinessType() = operationbom.BusinessType() ) )
              {
                alternativeproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive_DEBUG( depthlocal,
                                                                                    maxdepth,
                                                                                    uniquebomids_local,
                                                                                    isallowcrossbusinesstype );
              }
            }
            info( 'KKK2', this.DefinitionName(), "SetIsLinkedWithFinishedGoodAttributes_Recursive",
                  "| Depth:", depthlocal - 1,
                  "| BusinessType:", operation.BusinessType(),
                  "| OrganCode:", operation.OrganCode(),
                  "| ProcessSection:", operation.ProcessSection(),
                  "| ProductID:", operation.ProductID(),
                  "| isallowcrossbusinesstype:", isallowcrossbusinesstype,
                  "| IsLinkedWithFGCrossBusiness:", this.IsLinkedWithFGCrossBusiness(),
                  "| IsLinkedWithFinishedGood:", this.IsLinkedWithFinishedGood(),
                  "| UniqueBOMIDs:", uniquebomids_local.Unique().ToString( ";" ) );
          }
        }
        uniquebomids := uniquebomids_local.Unique().Difference( this.ID() );
        if( isallowcrossbusinesstype )
        {
          this.BOMCountCrossBusiness( uniquebomids.Size() );
          this.BOMIDsCrossBusiness( uniquebomids.ToString( ";" ) );
        }
        else
        {
          this.BOMCount( uniquebomids.Size() );
          this.BOMIDs( uniquebomids.ToString( ";" ) );
        }
        traverse( uniquebomids, Elements, uniquebomid,
                  uniquebomids_o.Find( uniquebomid ) < 0 )
        {
          uniquebomids_o.Add( uniquebomid );
        }
      }
      else
      {
        debuginfo( "Product:", this.ID(),
                   "| BusinessType:", this.BusinessType(),
                   "| IsAllowCrossBusinessType:", isallowcrossbusinesstype,
                   "| Max depth reached, stop searching... (", depth, ")" );
      }
    }
    else
    {
      if( uniquebomids_o.Find( this.ID() ) < 0 )
      {
        uniquebomids_o.Add( this.ID() );
      }
      uniquebomids := construct( Strings );
      if( isallowcrossbusinesstype )
      {
        uniquebomids := this.BOMIDsCrossBusiness().Tokenize( ";" );
      }
      else
      {
        uniquebomids := this.BOMIDs().Tokenize( ";" );
      }
      traverse( uniquebomids, Elements, uniquebomid,
                uniquebomids_o.Find( uniquebomid ) < 0 )
      {
        uniquebomids_o.Add( uniquebomid );
      }
    }
  *]
}