yypsybs
2023-09-25 99efdc3a1d2a85c727e48e32d96866a524fb59ed
_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer.qbl
@@ -8,26 +8,26 @@
  Description: '移交控制权'
  TextBody:
  [*
    // yypsybs Aug-25-2023 (created)
    if( isnull( oldMP ) ) {
        info( "========transfer ManufactureLTImputations to macroPlan " + [String]newMP.MDSID() + "========" );
    } else {
        info( "========transfer ManufactureLTImputations from macroPlan " + [String]oldMP.MDSID() + " to macroPlan " + [String]newMP.MDSID() + "========" );
    }
    // 清空新的,老的复制到新的,清空老的
    if( not isnull( oldMP ) and not isnull( newMP ) ) {
        info( "old ManufactureLTImputation size : " + [String]oldMP.ManufactureLTImputation( relsize ) )
        traverse( oldMP, ManufactureLTImputation, parent, true ) {
            traverse( parent, ManufactureLTProcessSection, child, true ) {
                  ManufactureLTProcessSection::CreateOrUpdate( newMP, parent.OrgCode(), parent.SkuID(), parent.Describe(),
                                                                child.ProcessSection(), child.Sequence(), child.Line(), child.SystemLT(),
                                                               child.Edited(), child.EditLT(), child.Describe() );
            }
        }
    }
    // 处理新的的operation
    traverse( newMP, Routing.RoutingStep.Operation, item ) {
         ManufactureLTProcessSection::CreateOrUpdate( item );
    }
    //// yypsybs Aug-25-2023 (created)
    //if( isnull( oldMP ) ) {
    //    info( "========transfer ManufactureLTImputations to macroPlan " + [String]newMP.MDSID() + "========" );
    //} else {
    //    info( "========transfer ManufactureLTImputations from macroPlan " + [String]oldMP.MDSID() + " to macroPlan " + [String]newMP.MDSID() + "========" );
    //}
    //// 清空新的,老的复制到新的,清空老的
    //if( not isnull( oldMP ) and not isnull( newMP ) ) {
    //    info( "old ManufactureLTImputation size : " + [String]oldMP.ManufactureLTImputation( relsize ) )
    //    traverse( oldMP, ManufactureLTImputation, parent, true ) {
    //        traverse( parent, ManufactureLTProcessSection, child, true ) {
    //              ManufactureLTProcessSection::CreateOrUpdate( newMP, parent.OrgCode(), parent.SkuID(), parent.Describe(),
    //                                                            child.ProcessSection(), child.Sequence(), child.Line(), child.SystemLT(),
    //                                                           child.Edited(), child.EditLT(), child.Describe() );
    //        }
    //    }
    //}
    //// 处理新的的operation
    //traverse( newMP, Routing.RoutingStep.Operation, item ) {
    //     ManufactureLTProcessSection::CreateOrUpdate( item );
    //}
  *]
}