From 198108cc439ee17bdbb4c809e63bd911846e971d Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期一, 11 十一月 2024 17:43:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 _Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl                                                |    2 
 _Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl                                          |    2 
 _Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl                                                 |    2 
 _Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl                                                     |   10 +----
 _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl                        |    8 ---
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable.def                |    2 -
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable#97.def        |    2 -
 _Main/BL/Type_Test/StaticMethod_Test.qbl                                                                      |    6 +--
 _Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl                                              |   26 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnClick.def |    6 +-
 _Main/BL/Type_LocalTool/StaticMethod_GetFactoryByUnit.qbl                                                     |   26 +++++++++++++
 11 files changed, 62 insertions(+), 30 deletions(-)

diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
index 6d71205..d7c5a6a 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
@@ -58,7 +58,7 @@
         yearcell.AllCost( yearcell.EstimateTotalCost() * [Real]yearcell.CoefficientValue() );
       }
     }
-    Transaction::Transaction().Propagate( attribute( CCEngineLogisticsCostCell, EstimateTotalCost ) );
+    
     traverse( yearcolumn, Cell, cell ){
       cell.EstimateTotalCost( cell.CalcEstimateTotalCost() );
       cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
index d5d4fcc..b7889a3 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
@@ -83,7 +83,7 @@
         yearcell.AllCost( yearcell.EstimateTotalCost() * [Real]yearcell.CoefficientValue() );
       }
     }
-    Transaction::Transaction().Propagate( attribute( DLEngineLogisticsCostCell, EstimateTotalCost ) );
+    
     traverse( yearcolumn, Cell, cell ){
       cell.EstimateTotalCost( cell.CalcEstimateTotalCost() );
       cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
diff --git a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
index fd802d5..ec03621 100644
--- a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
+++ b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
@@ -38,14 +38,8 @@
     now := DateTime::Now();
     macroPlanName := macroPlan.MDSMacroPlan().Description();
     traverse( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan,shiftPlan ,shiftPlan.UnitPeriodTime().Period_MP().StartDate() >= macroPlan.StartOfPlanning().Date()){
-       factory := shiftPlan.UnitPeriodTime().Unit();
-       while( factory.HasParent() ){
-         temp1 := factory;
-         factory := factory.Parent();
-         if( not factory.HasParent() ){
-           factory := temp1;
-         }
-       }
+       factory := LocalTool::GetFactoryByUnit( shiftPlan.UnitPeriodTime().Unit() );
+       
        productLine :=  shiftPlan.UnitPeriodTime().Unit().ID();
        shiftDate := shiftPlan.UnitPeriodTime().Period_MP().StartDate();
        factoryName := factory.ID();
diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
index cc5744c..9da63db 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
+++ b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -46,13 +46,7 @@
         unitIndex := guard( unitIndexTree.Root().Child( unitHandle ), null( NamedValue ));
         if( not isnull( unitIndex )){
           unit := units.Element( unitIndex.GetValueAsNumber() );
-          temp1 := unit;
-          temp2 := unit.Parent();
-          while( not isnull( temp1.Parent())){
-            temp2 := temp1;
-            temp1 := temp1.Parent();
-          }
-          factory := temp2;
+          factory := LocalTool::GetFactoryByUnit( unit );
         }
       }
       
diff --git a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
index bd2d81c..4231dde 100644
--- a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -86,7 +86,31 @@
       }
     }
       
-        
+    //搴撳瓨鍦ㄩ�旀暟鎹�
+    traverse( owner, Unit.Lane.LaneLeg, laneleg ){
+      originspid             := laneleg.OriginStockingPointID();
+      //璧峰鍦版槸闀挎槬
+      isccorigin             := originspid.StartsWith( '闀挎槬' ) or originspid.StartsWith( 'CC' );
+      //璧峰鍦版槸澶ц繛
+      isdlorigin             :=  originspid.StartsWith( '澶ц繛' ) or originspid.StartsWith( 'DL' );
+      if( isccorigin and isdlorigin ){
+        traverse( laneleg, Trip, trip, trip.LeadTime().Days() > 1 ){
+          for( transferdate := trip.Departure() + Duration::Days( 1 ); transferdate < trip.Arrival(); transferdate := transferdate + Duration::Days( 1 ) ){
+            daycolumn        := selectobject( table, InventorySummaryColumn, column, column.StartDate() = transferdate.Date(), column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
+            traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 ){
+              //鑾峰彇宸ュ巶琛�
+              factoryrow     := table.GetRow( ifexpr( isccorigin, ccunit, dlunit ), pit.Product_MP() );
+              //鑾峰彇鍚堣琛�
+              allrow              := table.GetRow( allunit, pit.Product_MP() );
+              quantity       := [Number]pit.Quantity();
+              factoryrow.SetCellValue( daycolumn, quantity );
+              allrow.SetCellValue( daycolumn, quantity );
+            }
+          }
+        }
+      }
+    }
+    
     rows                      := selectsortedset( table, InventroySummaryRow, row, row.Name() );
     i                         := 0;
     traverse( rows, Elements, e ){
diff --git a/_Main/BL/Type_LocalTool/StaticMethod_GetFactoryByUnit.qbl b/_Main/BL/Type_LocalTool/StaticMethod_GetFactoryByUnit.qbl
new file mode 100644
index 0000000..66b05c8
--- /dev/null
+++ b/_Main/BL/Type_LocalTool/StaticMethod_GetFactoryByUnit.qbl
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetFactoryByUnit (
+  const Unit unit
+) const as const Unit
+{
+  TextBody:
+  [*
+    // Akari Nov-11-2024 (created)
+    factory := constnull( Unit );
+    
+    if( isnull( unit ) or isnull( unit.Parent())){
+      factory := unit;
+    }else{
+      temp1 := unit;
+      temp2 := unit.Parent();
+      while( not isnull( temp1.Parent())){
+        temp2 := temp1;
+        temp1 := temp1.Parent();
+      }
+      factory := temp2;
+    }
+    
+    return factory;
+  *]
+}
diff --git a/_Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl b/_Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl
index de27233..86d0c58 100644
--- a/_Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl
+++ b/_Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl
@@ -33,7 +33,7 @@
       actproductionhandle  := actproductiontree.GetHandle( actproductionKey );
       actproductiontree.Root().AddChild( actproductionhandle,i ); 
     }
-    traverse( noptable, NewOfflinePlanRow, noprow ){
+    traverse( noptable, NewOfflinePlanRow, noprow, noprow.Type() = '1' ){
       row                  := table.GetRow( noprow );
       if( not isnull( row ) ){
         traverse( noprow, NewOfflinePlanCell, nopcell ){
diff --git a/_Main/BL/Type_Test/StaticMethod_Test.qbl b/_Main/BL/Type_Test/StaticMethod_Test.qbl
index 389d1dc..ea55e75 100644
--- a/_Main/BL/Type_Test/StaticMethod_Test.qbl
+++ b/_Main/BL/Type_Test/StaticMethod_Test.qbl
@@ -11,10 +11,8 @@
 {
   TextBody:
   [*
-    traverse( archive,ArchiveFile,object ){
-    //  object.Name();
-    //  object.FilePath();
-    //  object.SourceFileBinaryValue();
+    traverse( macroPlan,Unit,unit ){
+      info( LocalTool::GetFactoryByUnit( unit ).ID() ); 
     }
   *]
 }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable\04397.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable\04397.def"
index 566fb60..620cf41 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable\04397.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_MatrixEditorTable\04397.def"
@@ -18,7 +18,6 @@
           Properties:
           [
             DataType: 'FinancialProductionReport'
-            FixedFilter: 'not object.FinancialProductionColumn().IsDay()'
             Source: 'DataHolderTable'
             Taborder: 0
             Transformation: 'FinancialProductionColumn.FinancialProductionCell'
@@ -72,7 +71,6 @@
           Properties:
           [
             DataType: 'FinancialProductionReport'
-            FixedFilter: 'not object.IsDay()'
             Source: 'DataHolderTable'
             Taborder: 0
             Transformation: 'FinancialProductionColumn'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable.def
index 3139930..d78d2b2 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_MatrixEditorTable.def
@@ -18,7 +18,6 @@
           Properties:
           [
             DataType: 'FinancialSalesReport'
-            FixedFilter: 'not object.FinancialSalesColumn().IsDay()'
             Source: 'DataHolderTable'
             Taborder: 0
             Transformation: 'FinancialSalesColumn.FinancialSalesCell'
@@ -72,7 +71,6 @@
           Properties:
           [
             DataType: 'FinancialSalesReport'
-            FixedFilter: 'not object.IsDay()'
             Source: 'DataHolderTable'
             Taborder: 0
             Transformation: 'FinancialSalesColumn'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnClick.def
similarity index 64%
rename from _Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnCreated.def
rename to _Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnClick.def
index 455fd37..9a2f3b3 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Response_PanelOperation_ButtonSearch_OnClick.def
@@ -1,10 +1,10 @@
 Quintiq file version 2.0
 #parent: PanelOperation/ButtonSearch
-Response OnCreated () id:Response_PanelOperation_ButtonSearch_OnCreated
+Response OnClick () id:Response_PanelOperation_ButtonSearch_OnClick
 {
-  #keys: '[415136.0.1286390995]'
+  #keys: '[415136.0.1294002009]'
   CanBindMultiple: false
-  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  DefinitionID: 'Responsedef_WebButton_OnClick'
   QuillAction
   {
     Body:

--
Gitblit v1.9.3