| | |
| | | Description: 'ETL销售部门' |
| | | TextBody: |
| | | [* |
| | | // yypsybs Aug-15-2023 (created) |
| | | // 待处理数据 |
| | | listToDeal := construct( structured[MappingSalesSegment] ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, true ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingSalesSegment, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | } |
| | | //nameList := construct( structured[String] ); |
| | | //nameList := selectvalues( listToDeal, Elements, item, true, item.Name() ); |
| | | //// 检查parent |
| | | //traverse( listToDeal, Elements, item, item.ParentName() <> "" ) { |
| | | // if( nameList.Find( item.ParentName() ) = -1 ) { |
| | | // error( "sales segment parent not found: " + item.Name().AsQUILL() ); |
| | | // } |
| | | //// yypsybs Aug-15-2023 (created) |
| | | //// 待处理数据 |
| | | //listToDeal := construct( structured[MappingSalesSegment] ); |
| | | //if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | // listToDeal := selectset( this, MappingSalesSegment, item, true ); |
| | | //} else { |
| | | // listToDeal := selectset( this, MappingSalesSegment, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | //} |
| | | //// 逐层遍历,直至处理完成 |
| | | //dealtNameList := construct( structured[String] ); |
| | | //while( listToDeal.Size() <> dealtNameList.Size() ) { |
| | | // traverse( listToDeal, Elements, item ) { |
| | | // // 未处理过 |
| | | // if( dealtNameList.Find( item.Name() ) < 0 ){ |
| | | // // 无父部门,直接处理 |
| | | // if( item.ParentName() = "" ) { |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | // dealtNameList.Add( item.Name() ); |
| | | // } |
| | | // // 有父部门且父部门已处理 |
| | | // else if( item.ParentName() <> "" and dealtNameList.Find(item.ParentName()) >= 0 ) { |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | // dealtNameList.Add( item.Name() ); |
| | | // } |
| | | // // 有父部门且父部门未处理,下一轮处理 |
| | | // } |
| | | ////nameList := construct( structured[String] ); |
| | | ////nameList := selectvalues( listToDeal, Elements, item, true, item.Name() ); |
| | | ////// 检查parent |
| | | ////traverse( listToDeal, Elements, item, item.ParentName() <> "" ) { |
| | | //// if( nameList.Find( item.ParentName() ) = -1 ) { |
| | | //// error( "sales segment parent not found: " + item.Name().AsQUILL() ); |
| | | //// } |
| | | ////} |
| | | ////// 逐层遍历,直至处理完成 |
| | | ////dealtNameList := construct( structured[String] ); |
| | | ////while( listToDeal.Size() <> dealtNameList.Size() ) { |
| | | //// traverse( listToDeal, Elements, item ) { |
| | | //// // 未处理过 |
| | | //// if( dealtNameList.Find( item.Name() ) < 0 ){ |
| | | //// // 无父部门,直接处理 |
| | | //// if( item.ParentName() = "" ) { |
| | | //// SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | //// dealtNameList.Add( item.Name() ); |
| | | //// } |
| | | //// // 有父部门且父部门已处理 |
| | | //// else if( item.ParentName() <> "" and dealtNameList.Find(item.ParentName()) >= 0 ) { |
| | | //// SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | //// dealtNameList.Add( item.Name() ); |
| | | //// } |
| | | //// // 有父部门且父部门未处理,下一轮处理 |
| | | //// } |
| | | //// } |
| | | ////} |
| | | //traverse( listToDeal,Elements,item ){ |
| | | // if( item.ParentName() <> "" and isnull( SalesSegment_MP::FindByName( this, item.ParentName() ) ) ){ |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.ParentName(), item.DisplayIndex(), "" ); |
| | | // } |
| | | //} |
| | | traverse( listToDeal,Elements,item ){ |
| | | if( item.ParentName() <> "" and isnull( SalesSegment_MP::FindByName( this, item.ParentName() ) ) ){ |
| | | SalesSegment_MP::CreateOrUpdate( this, item.ParentName(), item.DisplayIndex(), "" ); |
| | | } |
| | | } |
| | | |
| | | traverse( listToDeal,Elements,item ){ |
| | | SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | } |
| | | // } |
| | | // |
| | | //traverse( listToDeal,Elements,item ){ |
| | | // SalesSegment_MP::CreateOrUpdate( this, item.Name(), item.DisplayIndex(), item.ParentName() ); |
| | | // } |
| | | *] |
| | | } |