From b7a523d87301d320b9bcfbb7e4c06495aef3170b Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期五, 06 十二月 2024 18:31:00 +0800
Subject: [PATCH] 优化

---
 _Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl                                           |   12 ++++++++----
 _Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl                             |   24 ++++++++++++++++++++++++
 _Main/UI/MacroPlannerWebApp/Views/LogisticsCostParameterSetting.vw                                        |    2 +-
 _Main/UI/MacroPlannerWebApp/Component_FormLogisticsCostMachining/Component_ListLogisticsCostMachining.def |    2 +-
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def      |    4 ++--
 5 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
index dc2965f..abccc2e 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -1,19 +1,23 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod GenerateReport (
-  MacroPlan macroPlan
+  MacroPlan macroPlan,
+  InterfaceDataset interfaceDataset
 )
 {
   TextBody:
   [*
     // 鍒涘缓鏁版嵁
-    PackagingPlanCell::CreateData( macroPlan );
+    //PackagingPlanCell::CreateData( macroPlan );
     
     // 璁剧疆鍖呰&鎷嗗寘-鏁伴噺锛堝ぇ杩炲伐鍘傦級
-    PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan );
+    //PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan );
     
     // 璁剧疆鍖呰&鎷嗗寘-鏁伴噺锛堥暱鏄ュ伐鍘傦級
-    PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan );
+    //PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan );
+    
+    // 璁剧疆璧峰鍖呰搴撳瓨
+    PackagingPlanCell::SetInitialPackagingInventory( macroPlan, interfaceDataset );
     
     //traverse ( macroPlan, PackagingPlanRow, ppr, ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Bosch" ) or ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Components (Spain)" ) ) {
     //  traverse ( ppr, PackagingPlanCell, ppc/*, ppc.StartDate() = Date::Construct( 2020, 4, 1 )*/ ) {
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl
new file mode 100644
index 0000000..c7b0782
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_SetInitialPackagingInventory.qbl
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SetInitialPackagingInventory (
+  MacroPlan macroPlan,
+  InterfaceDataset interfaceDataset
+)
+{
+  TextBody:
+  [*
+    iids := maxset( interfaceDataset, InventoryInterfaceData, tempIID, true, tempIID.Date() );
+    
+    traverse ( iids, Elements, iid, exists( iid, InventoryInterfaceDataDetail, tempIIDD, tempIIDD.InventoryPoint() = "SMEC" or tempIIDD.InventoryPoint() = "PMTL" ) ) {
+      traverse ( iid, InventoryInterfaceDataDetail, iidd, iidd.InventoryPoint() = "SMEC" or iidd.InventoryPoint() = "PMTL" ) {
+        factory := ifexpr( iidd.InventoryPoint() = "SMEC", "闀挎槬宸ュ巶", "澶ц繛宸ュ巶" );
+        
+        ppcell  := select( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPCell, 
+                           tempPPCell.PackagingPlanRow().ProductID()    = iidd.PartNumber()                          and
+                           tempPPCell.PackagingPlanColumn().StartDate() = ( macroPlan.StartOfPlanning().Date() - 1 ) and
+                           tempPPCell.PackagingPlanRow().Factory()      =  factory );
+        ppcell.PackagingInventory( iidd.Quantity() );
+      }
+    }
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormLogisticsCostMachining/Component_ListLogisticsCostMachining.def b/_Main/UI/MacroPlannerWebApp/Component_FormLogisticsCostMachining/Component_ListLogisticsCostMachining.def
index bb53ad9..04369af 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormLogisticsCostMachining/Component_ListLogisticsCostMachining.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormLogisticsCostMachining/Component_ListLogisticsCostMachining.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product","title":"浜у搧","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Product"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Factory","title":"宸ュ巶","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Factory"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"寮�濮嬫椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"缁撴潫鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PackagingCapacity","title":"鍖呰瀹归噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PackagingCapacity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WarehousingPrice","title":"鍏ュ簱鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WarehousingPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OutboundPrice","title":"鍑哄簱鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OutboundPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PackagePrice","title":"鍖呰鍗曚环(RMB/pcs)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PackagePrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnpackingPrice","title":"鎷嗗寘鍗曚环(RMB/pcs)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"UnpackingPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"BufferPaperPrice","title":"缂撳啿绾稿崟浠�(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"BufferPaperPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StoragePrice","title":"浠撳偍鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StoragePrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WoodenCratePrice","title":"鏈ㄧ鍗曚环","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WoodenCratePrice"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product","title":"浜у搧","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Product"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Factory","title":"宸ュ巶","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Factory"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"寮�濮嬫椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"缁撴潫鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PackagingCapacity","title":"鍖呰瀹归噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PackagingCapacity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WarehousingPrice","title":"鍏ュ簱鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WarehousingPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OutboundPrice","title":"鍑哄簱鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OutboundPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PackagePrice","title":"鍖呰鍗曚环(RMB/pcs)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PackagePrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnpackingPrice","title":"鎷嗗寘鍗曚环(RMB/pcs)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"UnpackingPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"BufferPaperPrice","title":"缂撳啿绾稿崟浠�(RMB/pcs)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"BufferPaperPrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StoragePrice","title":"浠撳偍鍗曚环(RMB/鎵�)","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StoragePrice"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WoodenCratePrice","title":"鏈ㄧ鍗曚环","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WoodenCratePrice"}}]'
         ContextMenu: 'listContextMenuLogisticsCostMachining'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def
index 8ac7a05..0184cfa 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def
@@ -7,13 +7,13 @@
   DefinitionID: 'Responsedef_WebButton_OnClick'
   Precondition:
   [*
-    return not isnull( MacroPlan );
+    return not isnull( MacroPlan ) and not isnull( InterfaceDataset );
   *]
   QuillAction
   {
     Body:
     [*
-      PackagingPlanCell::GenerateReport( MacroPlan );
+      PackagingPlanCell::GenerateReport( MacroPlan, InterfaceDataset );
       
       WebMessageBox::Success( Translations::A_VWED_Success() );
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Views/LogisticsCostParameterSetting.vw b/_Main/UI/MacroPlannerWebApp/Views/LogisticsCostParameterSetting.vw
index 1eb51aa..1a8959f 100644
--- a/_Main/UI/MacroPlannerWebApp/Views/LogisticsCostParameterSetting.vw
+++ b/_Main/UI/MacroPlannerWebApp/Views/LogisticsCostParameterSetting.vw
@@ -401,7 +401,7 @@
               dataType: 'real'
               index: 9
               subtotals: ''
-              width: 135
+              width: 146
             }
             column_StoragePrice
             {

--
Gitblit v1.9.3