From dc03b8a0920cb6793a37e3a9cc4cd83ff384be94 Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期四, 26 十月 2023 14:48:39 +0800
Subject: [PATCH] 实际库存、外部库存、库存成本、产品在车道实现多事业部分发

---
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingActualPISPIPData.qbl          |    7 ++++---
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl        |    7 ++++---
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingInventoryValueAndCostData.qbl |   12 ++++++++----
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingProductInLaneData.qbl         |   12 ++++++++----
 _Main/BL/Type_InventoryValueAndCost/StaticMethod_DoASync.qbl               |    4 ++--
 _Main/BL/Type_MacroPlan/StaticMethod_DoASync#253.qbl                       |    4 ++--
 6 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/_Main/BL/Type_InventoryValueAndCost/StaticMethod_DoASync.qbl b/_Main/BL/Type_InventoryValueAndCost/StaticMethod_DoASync.qbl
index 391ecf9..0b2323a 100644
--- a/_Main/BL/Type_InventoryValueAndCost/StaticMethod_DoASync.qbl
+++ b/_Main/BL/Type_InventoryValueAndCost/StaticMethod_DoASync.qbl
@@ -3,7 +3,7 @@
 StaticMethod DoASync (
   MacroPlan macroPlan,
   const GlobalOTDTable globalOTDTable,
-  String businessTypeName
+  Strings businessTypeNames
 )
 {
   TextBody:
@@ -12,6 +12,6 @@
     //info( "ActualPISPIP Finished, Start InventoryCost Data Broker" );
     //macroPlan.Broker_OTD_InventoryCost().Execute();
     info( "InventoryCost Data Broker Finished, Start InventoryCost Mapping" );
-    macroPlan.DoASyncMappingInventoryValueAndCostData(globalOTDTable,businessTypeName);
+    macroPlan.DoASyncMappingInventoryValueAndCostData(globalOTDTable,businessTypeNames);
   *]
 }
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingActualPISPIPData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingActualPISPIPData.qbl
index d2f5724..4c98455 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingActualPISPIPData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingActualPISPIPData.qbl
@@ -12,9 +12,10 @@
     // renhao Aug-14-2023 (created)
     listtodeal := construct( Global_MappingActualProductInStockingPointInPeriods, constcontent );
     if ( businessTypes.Size() > 0 ) {
-      businessTypeName := businessTypes.Element( 0 );
-      targetGlobal_ProductCategory := select( globalOTDTable, Global_ProductCategory, tempGPC, tempGPC.BusinessTypeName() = businessTypeName );
-      listtodeal := selectset( targetGlobal_ProductCategory, Global_MappingProduct_MP.Global_MAPISPIPCategory.Global_MappingActualProductInStockingPointInPeriod, 
+      targetGlobal_ProductCategory := selectset( globalOTDTable, Global_ProductCategory, tempGPC, 
+                                                 exists( businessTypes, Elements, tempBTN, tempBTN = tempGPC.BusinessTypeName() ) );
+      listtodeal := selectset( targetGlobal_ProductCategory, 
+                               Elements.Global_MappingProduct_MP.Global_MAPISPIPCategory.Global_MappingActualProductInStockingPointInPeriod, 
                                tempGMPIL, 
                                ( tempGMPIL.ActualInventoryLevelEnd() > 0 ) and 
                                ( organcodelist.Find( tempGMPIL.StockingPointID().SubString( 0, 3 ) ) >= 0 ) );
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl
index 6596139..ad47aed 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingExternalSupplyData.qbl
@@ -15,9 +15,10 @@
     
     listtodeal := construct( Global_MappingInventorySupplys, constcontent );
     if ( businessTypes.Size() > 0 ) {
-      businessTypeName := businessTypes.Element( 0 );
-      targetGlobal_ProductCategory := select( globalOTDTable, Global_ProductCategory, tempGPC, tempGPC.BusinessTypeName() = businessTypeName );
-      listtodeal := selectset( targetGlobal_ProductCategory, Global_MappingProduct_MP.Global_InventorySupplyCategory.Global_MappingInventorySupply, 
+      targetGlobal_ProductCategory := selectset( globalOTDTable, Global_ProductCategory, tempGPC, 
+                                                 exists( businessTypes, Elements, tempBTN, tempBTN = tempGPC.BusinessTypeName() ) );
+      listtodeal := selectset( targetGlobal_ProductCategory, 
+                               Elements.Global_MappingProduct_MP.Global_InventorySupplyCategory.Global_MappingInventorySupply, 
                                tempGMIS, 
                                ( tempGMIS.UserQuantity()>0 ) and 
                                ( tempGMIS.Date() >= queryStartDate ) and 
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingInventoryValueAndCostData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingInventoryValueAndCostData.qbl
index 78b1f55..b000fe9 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingInventoryValueAndCostData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingInventoryValueAndCostData.qbl
@@ -2,18 +2,22 @@
 #parent: #root
 Method DoASyncMappingInventoryValueAndCostData (
   const GlobalOTDTable globalOTDTable,
-  String businessTypeName
+  Strings businessTypeNames
 )
 {
   TextBody:
   [*
     // yypsybs Aug-15-2023 (created)
     listtodeal := construct( Global_MappingStockingPointCosts, constcontent );
-    if ( businessTypeName = "" ) {
+    if ( businessTypeNames.Size() = 0 ) {
       listtodeal := selectset( globalOTDTable,Global_MappingStockingPointCost,item,true );
     } else {
-      targetGlobal_ProductCategory := select( globalOTDTable, Global_ProductCategory, tempGPC, tempGPC.BusinessTypeName() = businessTypeName );
-      listtodeal := selectset( targetGlobal_ProductCategory, Global_MappingProduct_MP.Global_StockingPointCostCategory.Global_MappingStockingPointCost, tempGMPIL, true );
+      targetGlobal_ProductCategory := selectset( globalOTDTable, Global_ProductCategory, tempGPC, 
+                                                 exists( businessTypeNames, Elements, tempBTN, tempBTN = tempGPC.BusinessTypeName() ) );
+      listtodeal := selectset( targetGlobal_ProductCategory, 
+                               Elements.Global_MappingProduct_MP.Global_StockingPointCostCategory.Global_MappingStockingPointCost, 
+                               tempGMPIL, 
+                               true );
     }
     totalcount := listtodeal.Size();
     
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductInLaneData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductInLaneData.qbl
index 38a7a8b..b1434d1 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductInLaneData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductInLaneData.qbl
@@ -2,7 +2,7 @@
 #parent: #root
 Method DoASyncMappingProductInLaneData (
   const GlobalOTDTable globalOTDTable,
-  String businessTypeName
+  Strings businessTypeNames
 )
 {
   Description: 'Get Product In Line data'
@@ -11,11 +11,15 @@
     // Administrator Aug-17-2023 (created)
     // list to deal
     listtodeal := construct( Global_MappingProductInLanes, constcontent );
-    if ( businessTypeName = "" ) {
+    if ( businessTypeNames.Size() = 0 ) {
       listtodeal := selectset( globalOTDTable, Global_MappingProductInLane, item ,true );
     } else {
-      targetGlobal_ProductCategory := select( globalOTDTable, Global_ProductCategory, tempGPC, tempGPC.BusinessTypeName() = businessTypeName );
-      listtodeal := selectset( targetGlobal_ProductCategory, Global_MappingProduct_MP.Global_ProductInLineCategory.Global_MappingProductInLane, tempGMPIL, true );
+      targetGlobal_ProductCategory := selectset( globalOTDTable, Global_ProductCategory, tempGPC, 
+                                                 exists( businessTypeNames, Elements, tempBTN, tempBTN = tempGPC.BusinessTypeName() ) );
+      listtodeal := selectset( targetGlobal_ProductCategory, 
+                               Elements.Global_MappingProduct_MP.Global_ProductInLineCategory.Global_MappingProductInLane, 
+                               tempGMPIL, 
+                               true );
     }
     totalcount := listtodeal.Size();
     info( "ProductInLane has " + totalcount.AsQUILL() + " rows in total" );
diff --git "a/_Main/BL/Type_MacroPlan/StaticMethod_DoASync\043253.qbl" "b/_Main/BL/Type_MacroPlan/StaticMethod_DoASync\043253.qbl"
index 0f6ac65..50f6bc7 100644
--- "a/_Main/BL/Type_MacroPlan/StaticMethod_DoASync\043253.qbl"
+++ "b/_Main/BL/Type_MacroPlan/StaticMethod_DoASync\043253.qbl"
@@ -115,7 +115,7 @@
     //info( "Get Lanelegs From Api Finished, Start ProductInLane Data Broker" );
     //macroPlan.Broker_OTD_ProductInLane().Execute();
     info( "ProductInLane Data Broker Finished, Start ProductInLane Mapping" );
-    macroPlan.DoASyncMappingProductInLaneData(globalOTDTable,guard( businessTypeName.Element( 0 ), "" ));
+    macroPlan.DoASyncMappingProductInLaneData(globalOTDTable,businessTypeName);
     
     // 鍦ㄥ簱搴撳瓨鏁版嵁-13
     //info( "ProductInLane Finished, Start ActualPISPIP Data Broker" );
@@ -130,7 +130,7 @@
     macroPlan.DoASyncMappingExternalSupplyData( businessTypeName, isKeyProduct ,globalOTDTable, organcodelist );
     
     // 搴撳瓨鎴愭湰-15
-    InventoryValueAndCost::DoASync( macroPlan,globalOTDTable,guard( businessTypeName.Element( 0 ), "" ) );
+    InventoryValueAndCost::DoASync( macroPlan,globalOTDTable, businessTypeName );
     
     // todo 鍒堕�犳垚鏈�-16
     info( "InventoryCost Finished, Start OperationCost Mapping" );

--
Gitblit v1.9.3