From 8efa02c57ec252109a3d8bd9e72482ae353816ab Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期五, 22 十一月 2024 11:10:06 +0800
Subject: [PATCH] 修改下发班次计划为存档班次计划,添加班次计划存档功能

---
 _Main/BL/Type_ArchiveShiftPlanCell/Attribute_macroPlanName.qbl                                                                                 |    7 +++
 _Main/BL/Type_ArchiveShiftPlanCell/Attribute_MacroPlanMDSID.qbl                                                                                |    7 +++
 _Main/UI/MacroPlannerWebApp/Component_DialogPublishPlan/Method_OnOK.def                                                                        |    2 
 _Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl                                                                                      |   26 ++++++-------
 _Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl                                                                                |    1 
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProdu#791.def |    6 +-
 _Main/BL/Type_ArchiveShiftPlanRow/Attribute_FactoryName.qbl                                                                                    |    7 +++
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def                                        |   26 ++++++------
 _Main/BL/Type_ArchiveShiftPlanCell/StaticMethod_Archive.qbl                                                                                    |    8 +++
 9 files changed, 58 insertions(+), 32 deletions(-)

diff --git a/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_MacroPlanMDSID.qbl b/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_MacroPlanMDSID.qbl
new file mode 100644
index 0000000..e13837c
--- /dev/null
+++ b/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_MacroPlanMDSID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute MacroPlanMDSID
+{
+  #keys: '3[414996.1.240980117][414996.1.240980116][414996.1.240980118]'
+  ValueType: Key
+}
diff --git a/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_macroPlanName.qbl b/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_macroPlanName.qbl
new file mode 100644
index 0000000..721cfd6
--- /dev/null
+++ b/_Main/BL/Type_ArchiveShiftPlanCell/Attribute_macroPlanName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute MacroPlanName
+{
+  #keys: '3[414996.1.240980104][414996.1.240980103][414996.1.240980105]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_ArchiveShiftPlanCell/StaticMethod_Archive.qbl b/_Main/BL/Type_ArchiveShiftPlanCell/StaticMethod_Archive.qbl
index c40fdbc..39f1128 100644
--- a/_Main/BL/Type_ArchiveShiftPlanCell/StaticMethod_Archive.qbl
+++ b/_Main/BL/Type_ArchiveShiftPlanCell/StaticMethod_Archive.qbl
@@ -52,6 +52,8 @@
       archiveShiftPlanCellHandle := archiveShiftPlanCellIndexTree.GetHandle( shiftPlanCellKey );
       archiveShiftPlanCellIndex := guard( archiveShiftPlanCellIndexTree.Root().Child( archiveShiftPlanCellHandle ),null( NamedValue ) );
       if( isnull( archiveShiftPlanCellIndex )){
+        factory := LocalTool::GetFactoryByUnit( shiftPlanCell.UnitPeriodTime().Unit() );
+        
         archiveShiftPlanRow := null( ArchiveShiftPlanRow );
         archiveShiftPlanRowHandle := archiveShiftPlanRowIndexTree.GetHandle( shiftPlanRowKey );
         archiveShiftPlanRowIndex := guard( archiveShiftPlanRowIndexTree.Root().Child( archiveShiftPlanRowHandle ),null( NamedValue ));
@@ -60,8 +62,10 @@
           archiveShiftPlanRows.Add( archiveShiftPlanRow );
           archiveShiftPlanRowIndexTree.Root().AddChild( archiveShiftPlanRowHandle,archiveShiftPlanRows.Size() - 1 );
         }else{
-          archiveShiftPlanRow := archiveShiftPlanRows.Element( archiveShiftPlanRowIndex.GetValueAsNumber() ); 
+          archiveShiftPlanRow := archiveShiftPlanRows.Element( archiveShiftPlanRowIndex.GetValueAsNumber() );
         }
+        
+        archiveShiftPlanRow.FactoryName( factory.ID() );
         
         archiveShiftPlanColumn := null( ArchiveShiftPlanColumn );
         archiveShiftPlanColumnHandle := archiveShiftPlanColumnIndexTree.GetHandle( shiftPlanColumnKey );
@@ -85,6 +89,8 @@
       archiveShiftPlanCell.IsHoliday( shiftPlanCell.IsHoliday() );
       archiveShiftPlanCell.Outcome( shiftPlanCell.Outcome() );
       archiveShiftPlanCell.Remark( shiftPlanCell.Remark() );
+      archiveShiftPlanCell.MacroPlanName( shiftPlanCell.UnitPeriodTime().MacroPlan().MDSMacroPlan().Description() );
+      archiveShiftPlanCell.MacroPlanMDSID( shiftPlanCell.UnitPeriodTime().MacroPlan().MDSID() );
     }
   *]
 }
diff --git a/_Main/BL/Type_ArchiveShiftPlanRow/Attribute_FactoryName.qbl b/_Main/BL/Type_ArchiveShiftPlanRow/Attribute_FactoryName.qbl
new file mode 100644
index 0000000..f6462a0
--- /dev/null
+++ b/_Main/BL/Type_ArchiveShiftPlanRow/Attribute_FactoryName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute FactoryName
+{
+  #keys: '3[414996.1.241011396][414996.1.241011395][414996.1.241011397]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
index 0eaff48..c672705 100644
--- a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
+++ b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
@@ -2,7 +2,7 @@
 #parent: #root
 StaticMethod Dispatch (
   InterfaceDataset interfaceDataset,
-  const MacroPlan macroPlan,
+  const Archive archive,
   String executor
 )
 {
@@ -36,31 +36,29 @@
     }
     
     now := DateTime::Now();
-    macroPlanName := macroPlan.MDSMacroPlan().Description();
-    traverse( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan,shiftPlan ,shiftPlan.UnitPeriodTime().Period_MP().StartDate() >= macroPlan.StartOfPlanning().Date()){
-       factory := LocalTool::GetFactoryByUnit( shiftPlan.UnitPeriodTime().Unit() );
+    traverse( archive,ArchiveShiftPlanRow.ArchiveShiftPlanCell,archiveShiftPlan ){
+       factoryName := archiveShiftPlan.ArchiveShiftPlanRow().FactoryName();
        
-       productLine :=  shiftPlan.UnitPeriodTime().Unit().ID();
-       shiftDate := shiftPlan.UnitPeriodTime().Period_MP().StartDate();
-       factoryName := factory.ID();
+       productLine :=  archiveShiftPlan.ArchiveShiftPlanRow().UnitID();
+       shiftDate := archiveShiftPlan.ArchiveShiftPlanColumn().StartDate();
        
        dispatchShiftPlanHandle := dispatchShiftPlanIndexTree.GetHandle( factoryName + productLine + shiftDate.AsQUILL() );
        dispatchShiftPlanIndex := guard( dispatchShiftPlanIndexTree.Root().Child( dispatchShiftPlanHandle ),null( NamedValue ));
        if( not isnull( dispatchShiftPlanIndex )){
          dispatchShiftPlan := dispatchShiftPlans.Element( dispatchShiftPlanIndex.GetValueAsNumber() );
-         dispatchShiftPlan.Tips( shiftPlan.Remark() );
-         dispatchShiftPlan.VersionName( macroPlanName );
+         dispatchShiftPlan.Tips( archiveShiftPlan.Remark() );
+         dispatchShiftPlan.VersionName( archiveShiftPlan.MacroPlanName() );
          dispatchShiftPlan.InterfaceTime( now );
        }else{
-         if( shiftPlan.Outcome() <> "" ){
+         if( archiveShiftPlan.Outcome() <> "" ){
            interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(),
                                                ProductLine := productLine,
-                                               FactoryName := factory.ID(),
-                                               ShiftQty := shiftPlan.Outcome(),
+                                               FactoryName := factoryName,
+                                               ShiftQty := archiveShiftPlan.Outcome(),
                                   
                                                ShiftDate := shiftDate,
-                                               Tips := shiftPlan.Remark(),
-                                               VersionName := macroPlanName,
+                                               Tips := archiveShiftPlan.Remark(),
+                                               VersionName := archiveShiftPlan.MacroPlanName(),
                                                InterfaceTime := now );
          }
        }
diff --git a/_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl b/_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
index aeeb3ca..a05e213 100644
--- a/_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
+++ b/_Main/BL/Type_InterfaceDataset/Method_PublishPlanReportData.qbl
@@ -2,6 +2,7 @@
 #parent: #root
 Method PublishPlanReportData (
   const MacroPlan macroplan,
+  const Archive archive,
   Boolean iscustomdemanddl,
   Boolean iscustomdemandcc,
   Boolean isofflineplandl,
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
index e459113..269a374 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
@@ -38,17 +38,6 @@
         Taborder: 2
       ]
     }
-    Component ButtonActualDailyProduction
-    {
-      #keys: '[414996.1.186223693]'
-      BaseType: 'WebButton'
-      Properties:
-      [
-        Image: 'RSS'
-        Label: '瀹為檯姣忔棩鐢熶骇璁″垝'
-        Taborder: 3
-      ]
-    }
     Component ButtonInventoryPlanArchiveReport
     {
       #keys: '[415136.0.1277502282]'
@@ -57,7 +46,7 @@
       [
         Image: 'WAREHOUSE'
         Label: '璁″垝搴撳瓨瀛樻。'
-        Taborder: 4
+        Taborder: 3
       ]
     }
     Component ButtonArchivePackagingPlan
@@ -68,7 +57,7 @@
       [
         Image: 'PRODUCT'
         Label: 'Archive packaging plan'
-        Taborder: 5
+        Taborder: 4
       ]
     }
     Component ButtonArchiveTransferPlan
@@ -79,6 +68,17 @@
       [
         Image: 'TRUCK2_BLUE'
         Label: 'Archive transfer plan'
+        Taborder: 5
+      ]
+    }
+    Component ButtonActualDailyProduction id:ButtonActualDailyProduction_478
+    {
+      #keys: '[414996.1.241250423]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'RSS'
+        Label: '瀹為檯姣忔棩鐢熶骇璁″垝'
         Taborder: 6
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def "b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProdu\043791.def"
similarity index 81%
rename from _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def
rename to "_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProdu\043791.def"
index c2d70f3..6e57846 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def
+++ "b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProdu\043791.def"
@@ -1,8 +1,8 @@
 Quintiq file version 2.0
-#parent: ActionBarGroupArchiveReport/ButtonActualDailyProduction
-Response OnClick () id:Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProduction_OnClick
+#parent: ActionBarGroupArchiveReport/ButtonActualDailyProduction_478
+Response OnClick () id:Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProduction_OnClick_791
 {
-  #keys: '[414996.1.186223803]'
+  #keys: '[414996.1.241250422]'
   CanBindMultiple: false
   DefinitionID: 'Responsedef_WebButton_OnClick'
   QuillAction
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogPublishPlan/Method_OnOK.def b/_Main/UI/MacroPlannerWebApp/Component_DialogPublishPlan/Method_OnOK.def
index 40d6323..e15e3bf 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogPublishPlan/Method_OnOK.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogPublishPlan/Method_OnOK.def
@@ -56,7 +56,7 @@
     showlabel       := showlabel.Concat( '銆�' );
     currentuser     := QuintiqUser::CurrentUser().DisplayName();
     if( WebMessageBox::Question( this, showlabel, 'OK|Cancel' ) = 0 ){
-      InterfaceDataset.PublishPlanReportData( MacroPlan, cbCustomDemand.Checked()
+      InterfaceDataset.PublishPlanReportData( MacroPlan,Archive, cbCustomDemand.Checked()
                                               , cbCustomDemandCC.Checked()
                                               , cbOfflinePlan.Checked()
                                               , cbOfflinePlanCC.Checked()

--
Gitblit v1.9.3