From 1c013268e21a380f88a6688bdb5b0553d0ea7542 Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期日, 08 十月 2023 21:17:51 +0800
Subject: [PATCH] 产能分配结果Bug修改

---
 _Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl |    8 ++++----
 _Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl                   |   39 +++++++++++++++++++++------------------
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
index dcd7365..226f832 100644
--- a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
+++ b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -14,9 +14,9 @@
   [*
     numberOfLayers++;
     //info( "鐩爣鏃堕棿锛�", targetDate.Format( "Y-M2-D2" ) );
-    info( pisp.Name() );
+    //info( pisp.Name() );
     traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, pispippl.Start().Date() = targetDate ) {
-      info( "鏄惁鏈変緵搴旓細", pispippl.NewSupply( relsize ) > 0, "    搴撳瓨锛�", pispippl.InventoryLevelEnd() );
+      //info( "鏄惁鏈変緵搴旓細", pispippl.NewSupply( relsize ) > 0, "    搴撳瓨锛�", pispippl.InventoryLevelEnd() );
       if ( numberOfLayers <> 1 and pispippl.NewSupply( relsize ) = 0 ) {
         previous := pispippl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
         if ( not previous.Period_MP().IsHistorical() ) {
@@ -83,7 +83,7 @@
                                                        );
                                                         
             }
-            info( "-----------------------------------------------------------------------------------------------------------------" );
+            //info( "-----------------------------------------------------------------------------------------------------------------" );
           }
           
           PeriodTaskLaneLeg as ptll : {
@@ -92,7 +92,7 @@
     //        info( "灞傛暟锛�", numberOfLayers,"    褰撳墠渚涘簲鐨刾isp锛�", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    鎬讳緵搴斿�硷細", ns.Quantity(), "    闇�瑕佷緵搴斿�硷細", currentLayerDependentDemandQuantity,
     //              "    褰撳墠闇�姹俻isp锛�", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    闇�姹傚�硷細", currentLayerDependentDemandQuantity );
     //        info( "LaneLeg鍛ㄦ湡浠诲姟..." );
-            info( "-----------------------------------------------------------------------------------------------------------------" );
+            //info( "-----------------------------------------------------------------------------------------------------------------" );
             CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
                                                              targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
                                                              targetDate,
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
index f44304e..080565d 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -50,24 +50,27 @@
           id := id + "_" + item.Line();
         }
       operation := Operation::FindOperationTypeIndex( id );
-      account := Account_MP::FindByName( this, "Operation cost" );
-      isfromdb := false;
-      existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
-      if( isnull( existoperationcost ) ){
-        connecteditem := select( globalOTDTable, 
-                                 Global_MappingOperationCost,
-                                 moperationcost, 
-                                 moperationcost.OrgCode() = item.OrganCode(), 
-                                 moperationcost.ProductID() = item.ProductID() );
-        if( not isnull( connecteditem)){
-            cost := connecteditem.Cost();
-            lengthoftime := connecteditem.LengthOfTime();
-            start := connecteditem.Start();
-            timeunit := connecteditem.TimeUnit();
-            OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
-          }
-        
-        }
+      if(not isnull(operation)){
+            account := Account_MP::FindByName( this, "Operation cost" );
+            isfromdb := false;
+            existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
+            if( isnull( existoperationcost ) ){
+              connecteditem := select( globalOTDTable,
+                                       Global_MappingOperationCost,
+                                       moperationcost,
+                                       moperationcost.OrgCode() = item.OrganCode(),
+                                       moperationcost.ProductID() = item.ProductID() );
+              if( not isnull( connecteditem)){
+                  cost := connecteditem.Cost();
+                  lengthoftime := connecteditem.LengthOfTime();
+                  start := connecteditem.Start();
+                  timeunit := connecteditem.TimeUnit();
+                  OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
+                }
+
+              }
+      }
+
       }
   *]
 }

--
Gitblit v1.9.3