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_DispatchShiftPlan/StaticMethod_Dispatch.qbl |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

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 );
          }
        }

--
Gitblit v1.9.3