Kevin:
1. 把Operation.GetHasValidOperationInputOutput以让系统能够对没有投入料并非供应商生产单元的操作报告红色有效性检查移到了Routing.
2. 创建了GlobalOTDTable.SetIsLinkedWithFinishedGoodAttributes方法来检查中间表里的产品数据是否与生产成品的工艺路线连接起来了。
已添加7个文件
已删除1个文件
234 ■■■■ 文件已修改
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Routing/Method_DoSanityCheckData.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Routing/Method_GetHasTianmaNonSupplierOperationWithNoInput.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes
{
  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 );
    }
    traverse( this, Global_MappingOperation, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
    }
    traverse( this, Global_MappingOperationBOM, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
    }
    productspool := selectset( this, Global_MappingProduct_MP, product,
                               product.ProductMajorType() <> "成品" );
    operationspool := this.Global_MappingOperation( relget );
    operationbomspool := this.Global_MappingOperationBOM( relget );
    // Traverse each finished good and search for linked products/operations/lanes
    traverse( this, Global_MappingProduct_MP, product,
              product.ProductMajorType() = "成品" )
    {
      product.SetIsLinkedWithFinishedGoodAttributes_Recursive( 0, // depth
                                                               100, // maxdepth
                                                               productspool,
                                                               operationspool,
                                                               operationbomspool );
    }
  *]
}
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180207][157968.0.1145180206][157968.0.1145180208]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180190][157968.0.1145180189][157968.0.1145180191]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180168][157968.0.1145180167][157968.0.1145180169]'
  Description: 'Updated procedurally for checking whether this product is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes_Recursive (
  Number depth,
  Number maxdepth,
  Global_MappingProduct_MPs productspool,
  Global_MappingOperations operationspool,
  Global_MappingOperationBOMs operationbomspool
)
{
  Description: 'Method to traverse the supply chain recursively to determine if there are any products that are not used to produce finished goods.'
  TextBody:
  [*
    if( not this.IsLinkedWithFinishedGood() )
    {
      depth := depth + 1;
      this.IsLinkedWithFinishedGood( true );
      if( depth <= maxdepth )
      {
        operations := selectset( operationspool, Elements, operation,
                                 not operation.IsLinkedWithFinishedGood()
                                 and operation.BusinessType() = this.BusinessType()
                                 and operation.ProductID() = this.ID() );
        operationspool.Remove( operations );
        traverse( operations, Elements, operation )
        {
          operation.IsLinkedWithFinishedGood( true );
          operationboms := selectset( operationbomspool, Elements, operationbom,
                                      not operationbom.IsLinkedWithFinishedGood()
                                      and operationbom.BusinessType() = operation.BusinessType()
                                      and operationbom.OrganCode() = operation.OrganCode()
                                      and operationbom.ProcessSection() = operation.ProcessSection()
                                      and operationbom.ProductCode() = operation.ProductID() );
          operationbomspool.Remove( operationboms );
          traverse( operationboms, Elements, operationbom )
          {
            operationbom.IsLinkedWithFinishedGood( true );
            componentproduct := Global_MappingProduct_MP::FindTypeIndexIDAndBusinessType( operationbom.ComponentCode(),
                                                                                          operationbom.BusinessType() );
            if( guard( not componentproduct.IsLinkedWithFinishedGood(), false ) )
            {
              productspool.Remove( componentproduct );
              componentproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive( depth,
                                                                                maxdepth,
                                                                                productspool,
                                                                                operationspool,
                                                                                operationbomspool );
            }
            if( operationbom.AlternativeMaterialCode() <> ""
                and operationbom.AlternativeMaterialCode() <> operationbom.ComponentCode() )
            {
              alternativeproduct := Global_MappingProduct_MP::FindTypeIndexIDAndBusinessType( operationbom.AlternativeMaterialCode(),
                                                                                              operationbom.BusinessType() );
              if( guard( not alternativeproduct.IsLinkedWithFinishedGood(), false ) )
              {
                productspool.Remove( alternativeproduct );
                alternativeproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive( depth,
                                                                                    maxdepth,
                                                                                    productspool,
                                                                                    operationspool,
                                                                                    operationbomspool );
              }
            }
          }
        }
      }
      else
      {
        debuginfo( "Product:", this.ID(),
                   "| BusinessType:", this.BusinessType(),
                   "| Max depth reached, stop searching... (", depth, ")" );
      }
    }
  *]
}
_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_Routing/Method_DoSanityCheckData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: #root
Method DoSanityCheckData (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote #extension
{
  TextBody:
  [*
    // Adhi Feb-10-2016 (created)
    isvalid := true;
    isvalid := this.GetHasValidInput( feedback_o, sanitycheckfeedback_o ) and isvalid;
    isvalid := this.GetHasTianmaNonSupplierOperationWithNoInput( feedback_o, sanitycheckfeedback_o ) and isvalid;
    return isvalid;
  *]
}
_Main/BL/Type_Routing/Method_GetHasTianmaNonSupplierOperationWithNoInput.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
Quintiq file version 2.0
#parent: #root
Method GetHasTianmaNonSupplierOperationWithNoInput (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  TextBody:
  [*
    // Tianma change 20230925: If the unit is not a supplier, raise a data issue if there's no input
    value := forall( this, RoutingStep.Operation, operation,
                     guard( operation.Unit().IsSupplier(), false )
                     or operation.OperationInput( relsize ) > 0 );
    if( not value )
    {
      // Add instance text
      routingname := MacroPlan::GetSubstituteName( this.Name() );
      instance := Translations::MP_Routing_Instance( routingname );
      feedback := SanityCheckMessage::GetFormattedMessage( instance,
                                                           "非供应商操作没有投入料。" );
      feedback_o.Add( feedback );
      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() );
    }
    return value;
  *]
}