From 3cb5a54def670d97301f07170fcaad213bfc54f2 Mon Sep 17 00:00:00 2001 From: yypsybs <yypsybs@foxmail.com> Date: 星期六, 09 九月 2023 15:30:46 +0800 Subject: [PATCH] 同步逻辑由MacroPlan移到MPSync --- _Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl | 66 ++++++++++++++++---------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl index 873ed35..c1421d2 100644 --- a/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl +++ b/_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl @@ -7,39 +7,39 @@ Description: 'ETL璁㈠崟棰勬祴' TextBody: [* - // yypsybs Aug-15-2023 (created) - // 寰呭鐞嗘暟鎹� - listToDeal := construct( structured[MappingCustomerOrder] ); - if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { - listToDeal := selectset( this, MappingCustomerOrder, item, true ); - } else { - listToDeal := selectset( this, MappingCustomerOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); - } - queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); - queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); - listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); - - totalcount := listToDeal.Size(); - info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); - - count := 0; - // 澶勭悊 - traverse( listToDeal, Elements, item ) { - count := count + 1; - if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ - info( "Now is dealing with the " + count.AsQUILL() + "CustomerOrder " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); - } - // if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ - // info( item.ProductID().AsQUILL() ); - CustomerOrder::CreateOrUpdate( this, item.CurrencyID(), item.Customer(), item.CustomerID(), item.ID(), - item.OrderDate(), item.OrderID(), item.OrderLineID(), item.Price(), - item.PriorityName(), item.ProductID(), - item.StockPointID(), - item.SalesSegmentName(), - item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); - // }else{ - // info( "invaild product: " + item.ProductID().AsQUILL() ); + //// yypsybs Aug-15-2023 (created) + //// 寰呭鐞嗘暟鎹� + //listToDeal := construct( structured[MappingCustomerOrder] ); + //if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { + // listToDeal := selectset( this, MappingCustomerOrder, item, true ); + //} else { + // listToDeal := selectset( this, MappingCustomerOrder, item, businessTypes.Find( item.BusinessType() ) <> -1 ); + //} + //queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); + //queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); + //listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); + // + //totalcount := listToDeal.Size(); + //info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); + // + //count := 0; + //// 澶勭悊 + //traverse( listToDeal, Elements, item ) { + // count := count + 1; + // if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ + // info( "Now is dealing with the " + count.AsQUILL() + "CustomerOrder " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); // } - } + //// if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ + //// info( item.ProductID().AsQUILL() ); + // CustomerOrder::CreateOrUpdate( this, item.CurrencyID(), item.Customer(), item.CustomerID(), item.ID(), + // item.OrderDate(), item.OrderID(), item.OrderLineID(), item.Price(), + // item.PriorityName(), item.ProductID(), + // item.StockPointID(), + // item.SalesSegmentName(), + // item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); + //// }else{ + //// info( "invaild product: " + item.ProductID().AsQUILL() ); + //// } + //} *] } -- Gitblit v1.9.3