yanyuan
2023-11-01 c0048dc17d4fdb06ed42d8dc084bb7cf0bdb11c9
Fix log

修正了从中间表同步到MacroPlan的日志部分内容,但仍需进一步修正,同时修复了ProductInLane中的Find方法
已修改20个文件
已添加1个文件
231 ■■■■■ 文件已修改
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl 144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingActualProductInStockingPointInPeriod/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingConversionFactor/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCurrencyRate_MP/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCurrency_MP/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingForecast/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingInventorySupply/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingLane/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingLaneLeg/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperation/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperationBOM/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProductInLane/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingSalesSegment_MP/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingStockingPointCost/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingStockingPoint_MP/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingUnitCost/StaticMethod_SynchronizeMacroPlanData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingUnitOfMeasure_MP/StaticMethod_SynchronizeMacroPlanData.qbl 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInLane/StaticMethod_CreateOrUpdate.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInLane/StaticMethod_FindById.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl
@@ -50,77 +50,77 @@
    
    macroPlan.InitialUnitAndStockingPoint();
    info( organcodelist.Element( 0 ) );
    //
    //if ( isUnitOfMeasure_MP ) {
    //  Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan );
    //}
    //
    //if ( isCustomOrder ) {
    //  Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, businessTypes, organcodelist, executionUser );
    //}
    //
    //if ( isForeacst ) {
    //  Global_MappingForecast::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    //}
    //
    //if ( isSalesSegment_MP ) {
    //  Global_MappingSalesSegment_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes );
    //}
    //
    //if ( isProduct_MP ) {
    //  Global_MappingProduct_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, macroPlan.IsKeyProduct() );
    //}
    //
    //if ( isConversionFactor ) {
    //  Global_MappingConversionFactor::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    //
    //if ( isOperation ) {
    //  Global_MappingOperation::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    //}
    //
    //if ( isOperationBOM ) {
    //  Global_MappingOperationBOM::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct(), macroPlan.CreatePurchaseSupplyMaterial() );
    //}
    //
    //if ( isProductInLane ) {
    //  Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    //}
    //
    //if ( isAIPISPIP ) {
    //  Global_MappingActualProductInStockingPointInPeriod::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct() );
    //}
    //
    //if ( isInventorySupply ) {
    //  Global_MappingInventorySupply::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct() );
    //}
    //
    //if ( isStockingPointCost ) {
    //  Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    //}
    //
    //if ( isOperationCost ) {
    //  Global_MappingOperationCost::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    //}
    //
    //if ( isStockingPoint_MP ) {
    //  Global_MappingStockingPoint_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    //
    //if ( isCurrency_MP ) {
    //  Global_MappingCurrency_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    //
    //if ( isCurrencyRate_MP ) {
    //  Global_MappingCurrencyRate_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    //
    //if ( isLane ) {
    //  Global_MappingLane::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    //
    //if ( isLaneLeg ) {
    //  Global_MappingLaneLeg::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    //}
    if ( isUnitOfMeasure_MP ) {
      Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isCustomOrder ) {
      Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, businessTypes, organcodelist, executionUser );
    }
    if ( isForeacst ) {
      Global_MappingForecast::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    }
    if ( isSalesSegment_MP ) {
      Global_MappingSalesSegment_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes );
    }
    if ( isProduct_MP ) {
      Global_MappingProduct_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, macroPlan.IsKeyProduct() );
    }
    if ( isConversionFactor ) {
      Global_MappingConversionFactor::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isOperation ) {
      Global_MappingOperation::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    }
    if ( isOperationBOM ) {
      Global_MappingOperationBOM::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct(), macroPlan.CreatePurchaseSupplyMaterial() );
    }
    if ( isProductInLane ) {
      Global_MappingProductInLane::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    }
    if ( isAIPISPIP ) {
      Global_MappingActualProductInStockingPointInPeriod::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct() );
    }
    if ( isInventorySupply ) {
      Global_MappingInventorySupply::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist, macroPlan.IsKeyProduct() );
    }
    if ( isStockingPointCost ) {
      Global_MappingStockingPointCost::SynchronizeMacroPlanData( this, macroPlan, businessTypes, executionUser );
    }
    if ( isOperationCost ) {
      Global_MappingOperationCost::SynchronizeMacroPlanData( this, macroPlan, executionUser, businessTypes, organcodelist );
    }
    if ( isStockingPoint_MP ) {
      Global_MappingStockingPoint_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isCurrency_MP ) {
      Global_MappingCurrency_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isCurrencyRate_MP ) {
      Global_MappingCurrencyRate_MP::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isLane ) {
      Global_MappingLane::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
    if ( isLaneLeg ) {
      Global_MappingLaneLeg::SynchronizeMacroPlanData( this, macroPlan, executionUser );
    }
  *]
}
_Main/BL/Type_Global_MappingActualProductInStockingPointInPeriod/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -12,7 +12,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步实际库存数据",
                                                                       BrokerName := "同步实际库存数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingConversionFactor/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步单位转换数据",
                                                                       BrokerName := "同步单位转换数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingCurrencyRate_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步货币汇率数据",
                                                                       BrokerName := "同步货币汇率数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingCurrency_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步货币数据",
                                                                       BrokerName := "同步货币数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,7 +11,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步订单数据",
                                                                       BrokerName := "同步订单数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingForecast/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,7 +11,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步预测数据",
                                                                       BrokerName := "同步预测数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingInventorySupply/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -12,7 +12,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步在途库存数据",
                                                                       BrokerName := "同步在途库存数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingLane/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步车道数据",
                                                                       BrokerName := "同步车道数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingLaneLeg/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步车道路线数据",
                                                                       BrokerName := "同步车道路线数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingOperation/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,7 +11,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步工艺路线数据",
                                                                       BrokerName := "同步工艺路线数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingOperationBOM/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -13,7 +13,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步BOM数据",
                                                                       BrokerName := "同步BOM数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingProductInLane/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -10,7 +10,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步运输路线产品数据",
                                                                       BrokerName := "同步运输路线产品数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingProduct_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,7 +11,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步产品数据",
                                                                       BrokerName := "同步产品数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingSalesSegment_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -10,7 +10,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步销售部门数据",
                                                                       BrokerName := "同步销售部门数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingStockingPointCost/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -10,7 +10,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步库存成本数据",
                                                                       BrokerName := "同步库存成本数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingStockingPoint_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -9,7 +9,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步库存点数据",
                                                                       BrokerName := "同步库存点数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingUnitCost/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -11,7 +11,8 @@
  TextBody:
  [*
    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
                                                                       Name        := "同步制造成本数据",
                                                                       BrokerName := "同步制造成本数据",
                                                                       ExecutionStatus := "InOperation",
                                                                       IsSuccess   := true,
                                                                       ExecuteUser := executionUser
                                                                      );
_Main/BL/Type_Global_MappingUnitOfMeasure_MP/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -2,22 +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 {
      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_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;
  *]
}