Kevin:
1. 把Operation.GetHasValidOperationInputOutput以让系统能够对没有投入料并非供应商生产单元的操作报告红色有效性检查移到了Routing.
2. 创建了GlobalOTDTable.SetIsLinkedWithFinishedGoodAttributes方法来检查中间表里的产品数据是否与生产成品的工艺路线连接起来了。
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 ); |
| | | |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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, ")" ); |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | *] |
| | | } |