hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj
已修改39个文件
已添加10个文件
已删除1个文件
656 ■■■■■ 文件已修改
_Main/BL/Type_BaseConversionFactor/StaticMethod_CreateOrUpdate.qbl 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateCurrencyRate.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateCurrencyRateFromJson.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateFromMapping.qbl 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CurrencyRate_MP/StaticMethod_FindByIdAndStart.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Currency_MP/StaticMethod_CreateCurrency.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Currency_MP/StaticMethod_CreateFromMapping.qbl 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingActualProductInStockingPointInPeriod/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingConversionFactor/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCurrencyRate_MP/StaticMethod_SynchronizeMacroPlanData.qbl 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCurrency_MP/StaticMethod_SynchronizeMacroPlanData.qbl 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingForecast/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingInventorySupply/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingLane/StaticMethod_SynchronizeMacroPlanData.qbl 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingLaneLeg/StaticMethod_SynchronizeMacroPlanData.qbl 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperation/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperationBOM/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProductInLane/StaticMethod_SynchronizeMacroPlanData.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingSalesSegment_MP/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingStockingPointCost/StaticMethod_SynchronizeMacroPlanData.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingStockingPoint_MP/StaticMethod_SynchronizeMacroPlanData.qbl 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingUnitCost/StaticMethod_SynchronizeMacroPlanData.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingUnitOfMeasure_MP/StaticMethod_SynchronizeMacroPlanData.qbl 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventoryValueAndCost/StaticMethod_CreateOrUpdate.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventoryValueAndCost/StaticMethod_FindById.qbl 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_CreasteFromMapping.qbl 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_CreateLane.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_FindById.qbl 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Lane/StaticMethod_FindByIdAndUnit.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LaneLeg/StaticMethod_CreateFromMapping.qbl 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LaneLeg/StaticMethod_CreateLaneLegFromJson.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LaneLeg/StaticMethod_CreateLaneleg.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LaneLeg/StaticMethod_FindByIdAndLane.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/DefaultValue_BusinessType.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_ApiCurencyRatesData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_ApiLaneLegsData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_DoASyncMappingCustomerOrderData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#253.qbl 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInLane/StaticMethod_CreateOrUpdate.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInLane/StaticMethod_FindById.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_StockingPoint_MP/StaticMethod_CreateFromMapping.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_StockingPoint_MP/StaticMethod_CreateStockingpoint.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/_ROOT_Component_FormInterfaceTest.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_BaseConversionFactor/StaticMethod_CreateOrUpdate.qbl
@@ -26,6 +26,20 @@
      if( productId <> "" ) {
        product := Product_MP::FindById( macroPlan, productId );
      }else{
    //    info( productId );
    //    cf := select( source,
    //              AsSourceUnitOfMeasure,
    //              cf,
    //              ( cf.TargetUnitOfMeasure() = target
    //                or cf.TargetUnitOfMeasure() = source )
    //              and cf.Product_MP() = product
    //              );
    //    info( isnull( cf ) );
    //    info( "sourceuomname: " + cf.astype( BaseConversionFactor ).SourceUnitOfMeasureName() );
    //    info( "targetuomname: " + target.Name() );
    //    info( "cf.targetuomname: " + cf.astype( BaseConversionFactor ).TargetUnitOfMeasureName() );
    //    info( "productid: " + guard( product.ID(), "" ) );
    //    info( "cf.product: " + cf.astype( BaseConversionFactor ).ProductID() );
        result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable )
      }
    
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateCurrencyRate.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateCurrencyRate (
  MacroPlan mp,
  String currencyid,
  Date start,
  Real rate
@@ -11,10 +12,10 @@
  [*
    // Administrator Jul-19-2023 (created)
    isfromdb := true;
    currency := Currency_MP::FindCurrencyTypeIndex( currencyid );
    currency := Currency_MP::FindById( mp, currencyid );
    
    //create new currency
    result := CurrencyRate_MP::FindCurrencyRateTypeIndex( currencyid, start );
    result := CurrencyRate_MP::FindByIdAndStart( currency, currencyid, start );
    
    if( isnull( result ) )
    {
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateCurrencyRateFromJson.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateCurrencyRateFromJson (
  MacroPlan mp,
  JSON datarow
) as CurrencyRate_MP
{
@@ -16,7 +17,7 @@
    day := [Number]startstring.SubString( 8, 2 );
    
    start := Date::Construct( years, month, day );
    result := CurrencyRate_MP::CreateCurrencyRate( currencyid, start, rate );
    result := CurrencyRate_MP::CreateCurrencyRate( mp, currencyid, start, rate );
    
    return result;
  *]
_Main/BL/Type_CurrencyRate_MP/StaticMethod_CreateFromMapping.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateFromMapping (
  const GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    // Administrator Oct-31-2023 (created)
    updates := construct( CurrencyRate_MPs );
    traverse( globalOTDTable, Global_MappingCurrencyRate_MP, gcr, true )
    {
      a := CurrencyRate_MP::CreateCurrencyRate( macroPlan, gcr.CurrencyID(), gcr.Start(), gcr.Rate() );
      updates.Add( a );
      }
    origindataset := selectset( macroPlan, Currency_MP.CurrencyRate_MP, cr, true );
    obsoletes := origindataset.Difference( updates );
    // delete obsoleted
    difflength := obsoletes.Size();
    for( j:=0; j<difflength; j++ )
    {
      obsolete := obsoletes.Element( j );
      obsolete.Delete();
      }
  *]
}
_Main/BL/Type_CurrencyRate_MP/StaticMethod_FindByIdAndStart.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FindByIdAndStart (
  Currency_MP owner,
  String id,
  Date start
) as CurrencyRate_MP
{
  TextBody:
  [*
    // yypsybs Aug-14-2023 (created)
    result := select(  owner, CurrencyRate_MP, item, true, item.CurrencyID() = id and item.Start() = start );
    return result;
  *]
}
_Main/BL/Type_Currency_MP/StaticMethod_CreateCurrency.qbl
@@ -16,7 +16,7 @@
    isfromdb := true;
    
    //create new currency
    result := Currency_MP::FindCurrencyTypeIndex( id );
    result := Currency_MP::FindById( mp, id );
    
    if( isnull( result ) )
    {
_Main/BL/Type_Currency_MP/StaticMethod_CreateFromMapping.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateFromMapping (
  const GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    // Administrator Oct-31-2023 (created)
    updates := construct( Currency_MPs );
    traverse( globalOTDTable, Global_MappingCurrency_MP, gc, true )
    {
      a := Currency_MP::CreateCurrency( macroPlan, gc.ID(), gc.Name(), " ", gc.IsBase() );
      updates.Add( a );
      }
    origindataset := selectset( macroPlan, Currency_MP, c, true );
    obsoletes := origindataset.Difference( updates );
    // delete obsoleted
    difflength := obsoletes.Size();
    for( j:=0; j<difflength; j++ )
    {
      obsolete := obsoletes.Element( j );
      obsolete.Delete();
      }
  *]
}
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl
@@ -50,11 +50,11 @@
    macroPlan.InitialUnitAndStockingPoint();
    
    if ( isUnitOfMeasure_MP ) {
      Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan );
      Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    
    if ( isCustomOrder ) {
      Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, executionUser );
      Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, businessTypes, organcodelist, executionUser );
    }
    
    if ( isForeacst ) {
@@ -82,7 +82,7 @@
    }
    
    if ( isProductInLane ) {
      Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, executionUser );
      Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    }
    
    if ( isAIPISPIP ) {
@@ -94,7 +94,7 @@
    }
    
    if ( isStockingPointCost ) {
      Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, executionUser );
      Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    }
    
    if ( isOperationCost ) {
_Main/BL/Type_Global_MappingActualProductInStockingPointInPeriod/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -12,14 +12,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步实际库存数据",
                                                                       BrokerName := "同步实际库存数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingActualPISPIPData( businessTypes, globalOTDTable, isKeyProduct, organcodelist );
      macroPlan.DoASyncMappingActualPISPIPData( businessTypes, globalOTDTable, isKeyProduct, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingConversionFactor/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,14 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步单位转换数据",
                                                                       BrokerName := "同步单位转换数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingBaseConversionFactorData(globalOTDTable);
      macroPlan.DoASyncMappingBaseConversionFactorData(globalOTDTable);
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingCurrencyRate_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,29 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步货币汇率数据",
                                                                       BrokerName := "同步货币汇率数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      updates := construct( CurrencyRate_MPs );
      traverse( globalOTDTable, Global_MappingCurrencyRate_MP, gcr, true )
      {
        a := CurrencyRate_MP::CreateCurrencyRate( gcr.CurrencyID(), gcr.Start(), gcr.Rate() );
        updates.Add( a );
        }
      origindataset := selectset( macroPlan, Currency_MP.CurrencyRate_MP, cr, true );
      obsoletes := origindataset.Difference( updates );
      // delete obsoleted
      difflength := obsoletes.Size();
      for( j:=0; j<difflength; j++ )
      {
        obsolete := obsoletes.Element( j );
        obsolete.Delete();
        }
      CurrencyRate_MP::CreateFromMapping( globalOTDTable, macroPlan );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
_Main/BL/Type_Global_MappingCurrency_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,29 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步货币数据",
                                                                       BrokerName := "同步货币数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      updates := construct( Currency_MPs );
      traverse( globalOTDTable, Global_MappingCurrency_MP, gc, true )
      {
        a := Currency_MP::CreateCurrency( macroPlan, gc.ID(), gc.Name(), " ", gc.IsBase() );
        updates.Add( a );
        }
      origindataset := selectset( macroPlan, Currency_MP, c, true );
      obsoletes := origindataset.Difference( updates );
      // delete obsoleted
      difflength := obsoletes.Size();
      for( j:=0; j<difflength; j++ )
      {
        obsolete := obsoletes.Element( j );
        obsolete.Delete();
        }
      Currency_MP::CreateFromMapping( globalOTDTable, macroPlan );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -3,20 +3,23 @@
StaticMethod SynchronizeMacroPlanData (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan,
  Strings businessTypes,
  Strings organcodelist,
  String executionUser
)
{
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步订单数据",
                                                                       BrokerName := "同步订单数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      Global_MappingCustomOrder::CreateCustomOrder( globalOTDTable, macroPlan );
      macroPlan.DoASyncMappingCustomerOrderData( businessTypes, globalOTDTable, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingForecast/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,14 +11,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步预测数据",
                                                                       BrokerName := "同步预测数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingForecastData( businessTypes, globalOTDTable, organcodelist );
      macroPlan.DoASyncMappingForecastData( businessTypes, globalOTDTable, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingInventorySupply/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -12,14 +12,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步在途库存数据",
                                                                       BrokerName := "同步在途库存数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingExternalSupplyData( businessTypes, isKeyProduct ,globalOTDTable, organcodelist );
      macroPlan.DoASyncMappingExternalSupplyData( businessTypes, isKeyProduct, globalOTDTable, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingLane/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,61 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步车道数据",
                                                                       BrokerName := "同步车道数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      updates := construct( Lanes );
      traverse( globalOTDTable, Global_MappingLane, gl, true )
      {
        id := gl.ID();
        unitid := gl.UnitID();
        name := gl.Name();
        userleadtime := gl.UserLeadTime();
        processingtime := Duration::Zero();
        unitofmeasurename := "PCS";
        currencyid := "CNY";
        startdate := Date::Date( 1900, 1, 1 );
        enddate := Date::Date( 9999, 12, 31 );
        capacitytype := "Transport quantity";
        if( userleadtime.Length() = 0 )
        {
          processingtime := Duration::Zero();
          }
        else
        {
          processingtime := Duration::Hours( [Number]userleadtime );
          };
        unit := Unit::FindUnitTypeIndex( unitid );
        if( isnull( unit)){
          unit :=macroPlan.Unit( relnew,
                                 ID := unitid,
                                 Name := unitid,
                                 UnitOfMeasureName := unitofmeasurename,
                                 CurrencyID := currencyid,
                                 StartDate := startdate,
                                 EndDate := enddate,
                                 CapacityType := capacitytype );
        }
        a := Lane::CreateLane( unit, id, name, processingtime);
        updates.Add( a );
        }
      origindataset := selectset( macroPlan, Unit.Lane, l, true );
      obsoletes := origindataset.Difference( updates );
      // delete obsoleted
      difflength := obsoletes.Size();
      for( j:=0; j<difflength; j++ )
      {
        obsolete := obsoletes.Element( j );
        obsolete.Delete();
        }
      Lane::CreasteFromMapping( globalOTDTable, macroPlan );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
_Main/BL/Type_Global_MappingLaneLeg/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,44 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步车道路线数据",
                                                                       BrokerName := "同步车道路线数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      updates := construct( LaneLegs );
      traverse( globalOTDTable, Global_MappingLaneLeg, gll, true )
      {
        processingtime := Duration::Zero();
        hasprocessingtime := true;
        userleadtime := gll.UserLeadTime();
        if( userleadtime.Length() = 0 )
        {
          hasprocessingtime := false;
          processingtime := Duration::Zero();
          }
        else
        {
          hasprocessingtime := true;
          processingtime := Duration::Hours( [Number]userleadtime );
          };
        lane := Lane::FindLaneTypeIndex( gll.LaneID() );
        a := LaneLeg::CreateLaneleg(lane, gll.LaneID(), gll.OriginStockingPointID(), gll.DestinationStockingPointID(), gll.Name(), hasprocessingtime, processingtime);
        updates.Add( a );
        }
      origindataset := selectset( macroPlan, Unit.Lane.LaneLeg, ll, true );
      obsoletes := origindataset.Difference( updates );
      // delete obsoleted
      difflength := obsoletes.Size();
      for( j:=0; j<difflength; j++ )
      {
        obsolete := obsoletes.Element( j );
        obsolete.Delete();
        }
      LaneLeg::CreateFromMapping( globalOTDTable, macroPlan );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
_Main/BL/Type_Global_MappingOperation/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,14 +11,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步工艺路线数据",
                                                                       BrokerName := "同步工艺路线数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingOperationData( businessTypes ,globalOTDTable, organcodelist );
      macroPlan.DoASyncMappingOperationData( businessTypes, globalOTDTable, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingOperationBOM/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -13,14 +13,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步BOM数据",
                                                                       BrokerName := "同步BOM数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial, globalOTDTable, organcodelist );
      macroPlan.DoASyncMappingOperationBOMData( businessTypes, isKeyProduct, createPurchaseSupplyMaterial, globalOTDTable, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingProductInLane/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -3,20 +3,22 @@
StaticMethod SynchronizeMacroPlanData (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan,
  Strings businessTypes,
  String executionUser
)
{
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步运输路线产品数据",
                                                                       BrokerName := "同步运输路线产品数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingProductInLaneData(globalOTDTable);
      macroPlan.DoASyncMappingProductInLaneData( globalOTDTable, businessTypes );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingProduct_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,14 +11,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步产品数据",
                                                                       BrokerName := "同步产品数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingProductData( businessTypes, globalOTDTable,isKeyProduct );
      macroPlan.DoASyncMappingProductData( businessTypes, globalOTDTable, isKeyProduct );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingSalesSegment_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -10,14 +10,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步销售部门数据",
                                                                       BrokerName := "同步销售部门数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingSalesSegmentData( businessTypes, globalOTDTable );
      macroPlan.DoASyncMappingSalesSegmentData( businessTypes, globalOTDTable );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingStockingPointCost/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -3,20 +3,22 @@
StaticMethod SynchronizeMacroPlanData (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan,
  Strings businessTypes,
  String executionUser
)
{
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步库存成本数据",
                                                                       BrokerName := "同步库存成本数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingInventoryValueAndCostData(globalOTDTable);
      macroPlan.DoASyncMappingInventoryValueAndCostData( globalOTDTable, businessTypes );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingStockingPoint_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,29 +9,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步库存点数据",
                                                                       BrokerName := "同步库存点数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      updates := construct( StockingPoint_MPs );
      traverse( globalOTDTable, Global_MappingStockingPoint_MP, sp, true )
      {
        a := StockingPoint_MP::CreateStockingpoint( macroPlan, sp.ID(), sp.UnitID(), sp.Name() );
        updates.Add( a );
        }
      origindataset := selectset( macroPlan, StockingPoint_MP, sp, true );
      obsoletes := origindataset.Difference( updates );
      // delete obsoleted
      difflength := obsoletes.Size();
      for( j:=0; j<difflength; j++ )
      {
        obsolete := obsoletes.Element( j );
        obsolete.Delete();
        }
      StockingPoint_MP::CreateFromMapping( globalOTDTable, macroPlan );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
_Main/BL/Type_Global_MappingUnitCost/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,14 +11,15 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步制造成本数据",
                                                                       BrokerName := "同步制造成本数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
      
    try {
      macroPlan.MappingOperationCostData( globalOTDTable, businessTypes, organcodelist );
      macroPlan.DoASyncMappingOperationCostData( globalOTDTable, businessTypes, organcodelist );
      
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
_Main/BL/Type_Global_MappingUnitOfMeasure_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -2,30 +2,30 @@
#parent: #root
StaticMethod SynchronizeMacroPlanData (
  GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
  MacroPlan macroPlan,
  String executionUser
)
{
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name := "同步单位数据",
                                                                       IsSuccess := true
                                                                       BrokerName := "同步单位数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
                                            
    try {
      traverse ( globalOTDTable, Global_MappingUnitOfMeasure_MP, gmuommp ) {
        unitOfMeasure_MP := select( macroPlan, UnitOfMeasure_MP, tempUOMMP, tempUOMMP.Name() = gmuommp.Name() );
        if ( isnull( unitOfMeasure_MP ) ) {
          unitOfMeasure_MP := UnitOfMeasure_MP::Create( macroPlan, gmuommp.Name(), false, false );
        }
        if ( gmuommp.IsDefault() ) {
          unitOfMeasure_MP.SetAsDefault();
        }
      }
      macroPlan.DoASyncMappingUnitOfMeasureData(globalOTDTable);
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
    } onerror {
      global_BrokerExecuteLog.IsSuccess( false );
      global_BrokerExecuteLog.ErrorNo( e.ErrorNr() );
      global_BrokerExecuteLog.ErrorMessage( e.GeneralInformation() );
      global_BrokerExecuteLog.ErrorDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
    }
  *]
}
_Main/BL/Type_InventoryValueAndCost/StaticMethod_CreateOrUpdate.qbl
@@ -32,16 +32,16 @@
    //if( isnull( account ) ) {
    //    error( "account not found" );  
    //}
    result := InventoryValueAndCost::FindById( macroPlan, stockingPointId,productId,start,id );
    result := InventoryValueAndCost::FindById( macroPlan, stockingPointId, productId, start, id );
    if( not isnull( product) and not isnull( stockingPoint) and not isnull( account)){
      if( isnull( result ) ) {
        result := InventoryValueAndCost::Create( id, product, stockingPoint, account, costDriver, start, cost, true ).astype( InventoryValueAndCost );
      } else if( result.ProductID() <> productId ) {
        info( "cannot change product of inventory value and cost" )
      } 
    //  else {
    //    result.Update( account, costDriver, start, account.DefaultTimeUnit(), account.DefaultLengthOfTime(), cost, true );
    //  }
      else {
        result.Update( account, costDriver, start, account.DefaultTimeUnit(), account.DefaultLengthOfTime(), cost, true );
      }
    }
    
    return result;
_Main/BL/Type_InventoryValueAndCost/StaticMethod_FindById.qbl
@@ -12,6 +12,9 @@
  [*
    // yypsybs Aug-16-2023 (created)
    value := select( macroPlan, Product_MP.InventoryValueAndCost, item, true, item.ProductID()=productId and item.StockingPointID() = stockPointId and item.Start() = start );
    if( isnull( value ) ){
      value := select( macroPlan, Product_MP.InventoryValueAndCost, item, true, item.ID() = id );
      }
    return value;
  *]
}
_Main/BL/Type_Lane/StaticMethod_CreasteFromMapping.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreasteFromMapping (
  const GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    // Administrator Oct-31-2023 (created)
    updates := construct( Lanes );
    traverse( globalOTDTable, Global_MappingLane, gl, true )
    {
      id := gl.ID();
      unitid := gl.UnitID();
      name := gl.Name();
      userleadtime := gl.UserLeadTime();
      processingtime := Duration::Zero();
      unitofmeasurename := "PCS";
      currencyid := "CNY";
      startdate := Date::Date( 1900, 1, 1 );
      enddate := Date::Date( 9999, 12, 31 );
      capacitytype := "Transport quantity";
      if( userleadtime.Length() = 0 )
      {
        processingtime := Duration::Zero();
        }
      else
      {
        processingtime := Duration::Hours( [Number]userleadtime );
        };
      unit := Unit::FindById( macroPlan, unitid );
      if( isnull( unit)){
        unit :=macroPlan.Unit( relnew,
                               ID := unitid,
                               Name := unitid,
                               UnitOfMeasureName := unitofmeasurename,
                               CurrencyID := currencyid,
                               StartDate := startdate,
                               EndDate := enddate,
                               CapacityType := capacitytype );
      }
      a := Lane::CreateLane( macroPlan, unit, id, name, processingtime);
      updates.Add( a );
      }
    origindataset := selectset( macroPlan, Unit.Lane, l, true );
    obsoletes := origindataset.Difference( updates );
    // delete obsoleted
    difflength := obsoletes.Size();
    for( j:=0; j<difflength; j++ )
    {
      obsolete := obsoletes.Element( j );
      obsolete.Delete();
      }
  *]
}
_Main/BL/Type_Lane/StaticMethod_CreateLane.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateLane (
  MacroPlan mp,
  Unit unit,
  String id,
  String name,
@@ -19,7 +20,7 @@
    isfromdb := true;
    
    //create new stockingpoint
    result := Lane::FindLaneTypeIndex( id );
    result := Lane::FindById( mp, id );
    
    if( isnull( result ) )
    {
_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl
@@ -40,7 +40,7 @@
                   EndDate := enddate );
    }
    
    result := Lane::CreateLane( unit, id, name, processingtime);
    result := Lane::CreateLane( macroplan, unit, id, name, processingtime);
    
    return result;
  *]
_Main/BL/Type_Lane/StaticMethod_FindById.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FindById (
  MacroPlan mp,
  String id
) as Lane
{
  TextBody:
  [*
    // yypsybs Aug-14-2023 (created)
    result := select( mp, Unit.Lane, lane, true, lane.ID() = id );
    return result;
  *]
}
_Main/BL/Type_Lane/StaticMethod_FindByIdAndUnit.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FindByIdAndUnit (
  Unit unit,
  String id
) as Lane
{
  TextBody:
  [*
    // yypsybs Aug-14-2023 (created)
    result := select(  unit, Lane, item, true, item.ID() = id );
    return result;
  *]
}
_Main/BL/Type_LaneLeg/StaticMethod_CreateFromMapping.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateFromMapping (
  const GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    // Administrator Oct-31-2023 (created)
    updates := construct( LaneLegs );
    traverse( globalOTDTable, Global_MappingLaneLeg, gll, true )
    {
      processingtime := Duration::Zero();
      hasprocessingtime := true;
      userleadtime := gll.UserLeadTime();
      if( userleadtime.Length() = 0 )
      {
        hasprocessingtime := false;
        processingtime := Duration::Zero();
        }
      else
      {
        hasprocessingtime := true;
        processingtime := Duration::Hours( [Number]userleadtime );
        };
      lane := Lane::FindById( macroPlan, gll.LaneID() );
      a := LaneLeg::CreateLaneleg( macroPlan, lane, gll.LaneID(), gll.OriginStockingPointID(), gll.DestinationStockingPointID(), gll.Name(), hasprocessingtime, processingtime);
      updates.Add( a );
      }
    origindataset := selectset( macroPlan, Unit.Lane.LaneLeg, ll, true );
    obsoletes := origindataset.Difference( updates );
    // delete obsoleted
    difflength := obsoletes.Size();
    for( j:=0; j<difflength; j++ )
    {
      obsolete := obsoletes.Element( j );
      obsolete.Delete();
      }
  *]
}
_Main/BL/Type_LaneLeg/StaticMethod_CreateLaneLegFromJson.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateLaneLegFromJson (
  MacroPlan mp,
  JSON datarow
) as LaneLeg
{
@@ -29,7 +30,7 @@
    
    lane := Lane::FindLaneTypeIndex( laneid );
    
    result := LaneLeg::CreateLaneleg(lane, laneid, originstockingpointid, destinationstockingpointid, name, hasprocessingtime, processingtime);
    result := LaneLeg::CreateLaneleg( mp, lane, laneid, originstockingpointid, destinationstockingpointid, name, hasprocessingtime, processingtime);
    
    return result;
  *]
_Main/BL/Type_LaneLeg/StaticMethod_CreateLaneleg.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateLaneleg (
  MacroPlan mp,
  Lane lane,
  String laneid,
  String originstockingpointid,
@@ -25,16 +26,16 @@
    isfromdb := true;
    
    //create new stockingpoint
    originstockingpoint := StockingPoint_MP::FindStockingPointTypeIndex( originstockingpointid );
    originstockingpoint := StockingPoint_MP::FindById( mp, originstockingpointid );
    lane.AddStockingPoint( originstockingpoint, true, isfromdb );
    Transaction::Transaction().Propagate();
    
    destinationstockingpoint := StockingPoint_MP::FindStockingPointTypeIndex( destinationstockingpointid );
    destinationstockingpoint := StockingPoint_MP::FindById( mp, destinationstockingpointid );
    lane.AddStockingPoint( destinationstockingpoint, false, isfromdb );
    
    Transaction::Transaction().Propagate();
    
    result := LaneLeg::FindLaneLegTypeIndex( laneid, originstockingpointid, destinationstockingpointid );
    result := LaneLeg::FindByIdAndLane( lane, originstockingpointid, destinationstockingpointid );
    
    if( isnull( result ) )
    {
_Main/BL/Type_LaneLeg/StaticMethod_FindByIdAndLane.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FindByIdAndLane (
  Lane lane,
  String originstockingpointid,
  String destinationstockingpointid
) as LaneLeg
{
  TextBody:
  [*
    // yypsybs Aug-14-2023 (created)
    result := select(  lane, LaneLeg, item, true, item.OriginStockingPointID() = originstockingpointid and item.DestinationStockingPointID() = destinationstockingpointid );
    return result;
  *]
}
_Main/BL/Type_MacroPlan/DefaultValue_BusinessType.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_MacroPlan/Method_ApiCurencyRatesData.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
Method ApiCurencyRatesData (
  MacroPlan mp,
  JSON data
)
{
@@ -14,7 +15,7 @@
    for( i:=0; i<data_length; i++ )
    {
      datarow := data.Get( i );
      a := CurrencyRate_MP::CreateCurrencyRateFromJson( datarow );
      a := CurrencyRate_MP::CreateCurrencyRateFromJson( mp, datarow );
      updates.Add( a );
      }
    origindataset := selectset( this, Currency_MP.CurrencyRate_MP, cr, true );
_Main/BL/Type_MacroPlan/Method_ApiLaneLegsData.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
Method ApiLaneLegsData (
  MacroPlan mp,
  JSON data
)
{
@@ -14,7 +15,7 @@
    for( i:=0; i<data_length; i++ )
    {
      datarow := data.Get( i );
      a := LaneLeg::CreateLaneLegFromJson( datarow );
      a := LaneLeg::CreateLaneLegFromJson( mp, datarow );
      updates.Add( a );
      }
    origindataset := selectset( this, Unit.Lane.LaneLeg, ll, true );
_Main/BL/Type_MacroPlan/Method_DoASyncMappingCustomerOrderData.qbl
@@ -22,7 +22,7 @@
                                 ( organcodelist.Find( item.StockingPointID().SubString( 0, 3 ) ) >= 0 ) );
    }
    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() );
    //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.StockingPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) );
    
    totalcount := listToDeal.Size();
_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl
@@ -11,7 +11,7 @@
  [*
    // renhao Aug-14-2023 (created)
    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() );
    //queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
    
    listtodeal := construct( Global_MappingInventorySupplys, constcontent );
    if ( businessTypes.Size() > 0 ) {
_Main/BL/Type_MacroPlan/StaticMethod_DoASync#253.qbl
@@ -17,6 +17,8 @@
    info( "Prepare to do sync" )
    info( "Get organ code list" )
    businessTypeName := businessType.BusinessTypeName().Tokenize( "," );
    macroPlan.BusinessType( businessType.BusinessTypeName() );
    organcodelist := selectvalues( businessType, OrganCode, organ, true, organ.OrganCodeName() );
    
    if( organcodelist.Size() = 0 ){
@@ -44,34 +46,23 @@
    macroPlan.DoASyncMappingUnitData( businessTypeName ,globalOTDTable, organcodelist);
    
    // åº“存点-3
    info( "Sales Segment Finished, Start Get StockingPoint From Api" )
    parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "StockingPoint" );
    postrequestbody := parameter.PostRequestBody();
    address := parameter.Address();
    url := parameter.AttributeValue();
    port := [Number]parameter.Port();
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiStockingPointData( data );
    info( "Sales Segment Finished, Start Get StockingPoint From Mapping" )
    StockingPoint_MP::CreateFromMapping( globalOTDTable, macroPlan );
    //parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "StockingPoint" );
    //postrequestbody := parameter.PostRequestBody();
    //address := parameter.Address();
    //url := parameter.AttributeValue();
    //port := [Number]parameter.Port();
    //data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    //macroPlan.ApiStockingPointData( data );
    
    // è´§å¸ä¿¡æ¯-4
    info( "Get StockingPoint From Api Finished, Start Get CurrencyInfo From Api" )
    parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "CurrencyInfo" );
    postrequestbody := parameter.PostRequestBody();
    address := parameter.Address();
    url := parameter.AttributeValue();
    port := [Number]parameter.Port();
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiCurenciesData( data );
    info( "Get StockingPoint From Api Finished, Start Get CurrencyInfo From Mapping" )
    Currency_MP::CreateFromMapping( globalOTDTable, macroPlan );
    
    //货币汇率信息-5
    info( "Get CurrencyInfo From Api Finished, Start Get CurrencyRates From Api" )
    parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "CurrencyRates" );
    postrequestbody := parameter.PostRequestBody();
    address := parameter.Address();
    url := parameter.AttributeValue();
    port := [Number]parameter.Port();
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiCurencyRatesData( data );
    info( "Get CurrencyInfo From Api Finished, Start Get CurrencyRates From Mapping" )
    CurrencyRate_MP::CreateFromMapping( globalOTDTable, macroPlan );
    
    // äº§å“ç‰©æ–™-6
    //info( "Get CurrencyRates From Api Finished, Start Product Data Broker" )
@@ -92,24 +83,12 @@
    macroPlan.DoASyncMappingOperationBOMData( businessTypeName, isKeyProduct, createPurchaseSupplyMaterial,globalOTDTable, organcodelist );
    
    //车道信息-10
    info( "BOM Finished, Start Get Lanes From Api" );
    parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "Lanes" );
    postrequestbody := parameter.PostRequestBody();
    address := parameter.Address();
    url := parameter.AttributeValue();
    port := [Number]parameter.Port();
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiLanesData( data );
    info( "BOM Finished, Start Get Lanes From Mapping" );
    Lane::CreasteFromMapping( globalOTDTable, macroPlan );
    
    //车道运输段-11
    info( "Get Lanes From Api Finished, Start Get LaneLegs From Api" );
    parameter := select( globalOTDTable, GlobalParameters, param, param.AttributeName() = "LaneLegs" );
    postrequestbody := parameter.PostRequestBody();
    address := parameter.Address();
    url := parameter.AttributeValue();
    port := [Number]parameter.Port();
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiLaneLegsData( data );
    info( "Get Lanes From Api Finished, Start Get LaneLegs From Mapping" );
    LaneLeg::CreateFromMapping( globalOTDTable, macroPlan );
    
    // ä¾›åº”网络(车道)-12
    //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" );
_Main/BL/Type_MacroPlan/StaticMethod_DoSync0.qbl
@@ -71,7 +71,7 @@
    url := "/otdService/https/GetCurrencyRatesInfo";
    port := 443;
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiCurencyRatesData( data );
    macroPlan.ApiCurencyRatesData( macroPlan, data );
    
    // äº§å“ç‰©æ–™-6
    //info( "Get CurrencyRates From Api Finished, Start Product Data Broker" )
@@ -109,7 +109,7 @@
    url := "/otdService/https/GetLaneLegsInfo";
    port := 443;
    data := macroPlan.ApiResponesCheck( address, url, port, postrequestbody );
    macroPlan.ApiLaneLegsData( data );
    macroPlan.ApiLaneLegsData( macroPlan, data );
    
    // ä¾›åº”网络(车道)-12
    //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" );
_Main/BL/Type_PriorityResult/StaticMethod_CalculateScore.qbl
@@ -35,7 +35,7 @@
                // æˆªå–掉已经计算的优先级因子 é€’归计算
                remindFormula := PriorityResult::GetRemindFormula( remindFormula,macroPlan);
                score := score + PriorityResult::CalculateScore( remindFormula,customerOrder,businessType,macroPlan,score,globalOTDTable);
            }else if( remindFormula.StartsWith( "*" ) ){
            }else if( remindFormula.StartsWith( "x" ) ){
                remindFormula := remindFormula.SubString( 1,remindFormula.Length()-1);
                score := PriorityResult::GetDetailsValue( customerOrder,remindFormula,macroPlan,globalOTDTable);
                score := lastScore * score;
_Main/BL/Type_ProductInLane/StaticMethod_CreateOrUpdate.qbl
@@ -15,15 +15,15 @@
    
    // Get product&line
    product :=  Product_MP::FindById( owner, productid );
    line :=  Lane::FindLaneTypeIndex( lineid );
    line :=  Lane::FindById( owner, lineid );
    
    if( not isnull( product) and not isnull( line)){
      productinline := ProductInLane::FindProductInLaneTypeIndex( lineid, productid );
      productinline := ProductInLane::FindById( owner, productid, lineid );
    
      if( isnull( productinline ) ){
      ProductInLane::Create( product, line, isexcluded, isfromdb );
      }else{
       productinline.Update( productid, lineid, isexcluded, isfromdb );
        productinline.Update( lineid, productid, isexcluded, isfromdb );
        }
    }
  *]
_Main/BL/Type_ProductInLane/StaticMethod_FindById.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FindById (
  MacroPlan mp,
  String id,
  String laneid
) as ProductInLane
{
  TextBody:
  [*
    // yy 2023-11-01
    result := select( mp, Product_MP.ProductInLane, pil, true, pil.ProductID() = id and pil.LaneID() = laneid );
    return result;
  *]
}
_Main/BL/Type_StockingPoint_MP/StaticMethod_CreateFromMapping.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateFromMapping (
  const GlobalOTDTable globalOTDTable,
  MacroPlan macroPlan
)
{
  Description: '从mapping表创建库存点'
  TextBody:
  [*
    // Administrator Oct-31-2023 (created)
    updates := construct( StockingPoint_MPs );
    traverse( globalOTDTable, Global_MappingStockingPoint_MP, sp, true )
    {
      a := StockingPoint_MP::CreateStockingpoint( macroPlan, sp.ID(), sp.UnitID(), sp.Name() );
      updates.Add( a );
      }
    origindataset := selectset( macroPlan, StockingPoint_MP, sp, true );
    obsoletes := origindataset.Difference( updates );
    // delete obsoleted
    difflength := obsoletes.Size();
    for( j:=0; j<difflength; j++ )
    {
      obsolete := obsoletes.Element( j );
      obsolete.Delete();
      }
  *]
}
_Main/BL/Type_StockingPoint_MP/StaticMethod_CreateStockingpoint.qbl
@@ -22,7 +22,7 @@
    isfromdb := true;
    
    //create new stockingpoint
    result := StockingPoint_MP::FindStockingPointTypeIndex( id );
    result := StockingPoint_MP::FindById( mp, id );
    
    if( isnull( result ) )
    {
_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/_ROOT_Component_FormInterfaceTest.def
@@ -23,6 +23,16 @@
        Taborder: 0
      ]
    }
    Component DataHolderInterfaceTest
    {
      #keys: '[414502.0.443241895]'
      BaseType: 'WebDataHolder'
      Databinding: 'Scenario'
      Properties:
      [
        Taborder: 7
      ]
    }
  ]
  Properties:
  [