From 8e0a788a86811db1894d1d517eb9817beeaeaf29 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期二, 26 十一月 2024 09:29:20 +0800
Subject: [PATCH] 修复一些bug

---
 _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl |   39 ++++++++++++++++++++++++---------------
 1 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
index b5c8382..9aa35e0 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
+++ b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_GenerateDispatchData.qbl
@@ -53,16 +53,16 @@
       
       traverse( row,NewOfflinePlanCell,cell, startDate <= cell.NewOfflinePlanColumn().StartDate() and endDate >= cell.NewOfflinePlanColumn().EndDate()){
         product := null( DispatchShiftSchedulingProduct );
-        remark := "";
+        tips := "";
         if( not isnull( unit )){
-          remark := ShiftPlan::CalculateRemark( unit,cell.NewOfflinePlanColumn().StartDate(),cell.NewOfflinePlanColumn().EndDate() );
+          tips := ShiftPlan::CalculateRemark( unit,cell.NewOfflinePlanColumn().StartDate(),cell.NewOfflinePlanColumn().EndDate() );
         }
         {
           lineKey := row.ProductionLine() + cell.NewOfflinePlanColumn().StartDate().AsQUILL();
           lineHandle := lineIndexTree.GetHandle( lineKey );
           lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue ));
           if( isnull( lineIndex )){
-            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate(),Remark := remark );
+            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewOfflinePlanColumn().StartDate(),Tips := tips );
             line.FactoryName( factory.Name() );
             line.InterfaceTime( now );
             line.VersionName( macroPlan.MDSMacroPlan().Description() );
@@ -108,16 +108,16 @@
       
       traverse( row,NewAssemblyOnlinePlanCell,cell, startDate <= cell.NewAssemblyOnlinePlanColumn().StartDate() and endDate >= cell.NewAssemblyOnlinePlanColumn().EndDate()){
         product := null( DispatchShiftSchedulingProduct );
-        remark := "";
+        tips := "";
         if( not isnull( unit )){
-          remark := ShiftPlan::CalculateRemark( unit,cell.NewAssemblyOnlinePlanColumn().StartDate(),cell.NewAssemblyOnlinePlanColumn().EndDate() );
+          tips := ShiftPlan::CalculateRemark( unit,cell.NewAssemblyOnlinePlanColumn().StartDate(),cell.NewAssemblyOnlinePlanColumn().EndDate() );
         }
         {
           lineKey := row.ProductionLine() + cell.NewAssemblyOnlinePlanColumn().StartDate().AsQUILL();
           lineHandle := lineIndexTree.GetHandle( lineKey );
           lineIndex := guard( lineIndexTree.Root().Child( lineHandle ),null( NamedValue ));
           if( isnull( lineIndex )){
-            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate(),Remark := remark );
+            line := owner.DispatchShiftSchedulingLine( relnew,ID := IDHolder::GetGUID(),LineName := row.ProductionLine(),ShiftDate := cell.NewAssemblyOnlinePlanColumn().StartDate(),Tips := tips );
             line.FactoryName( factory.Name() );
             line.InterfaceTime( now );
             line.VersionName( macroPlan.MDSMacroPlan().Description() );
@@ -156,7 +156,7 @@
         singleShiftVolume2 := 0.0;
         singleShiftVolume3 := 0.0;
         
-        if( line.Remark().LikeUserLocale( "淇濆吇" )){
+        if( line.Tips().LikeUserLocale( "淇濆吇" )){
           singleShiftVolume1 := 0.0;
           singleShiftVolume2 := lineQuantity / 2;
           singleShiftVolume3 := lineQuantity / 2;
@@ -170,29 +170,35 @@
           product := tempProducts.Element( i );
           productionQuantity := product.ProductionQuantity();
           
+          if( line.Tips().LikeUserLocale( "淇濆吇" ) and productionQuantity > 0){
+            product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := 0 ,SingleShiftName := "鐧界彮");
+          }
+          
           if( singleShiftVolume1 > 0 and productionQuantity > 0){
             tempProductQuantity := singleShiftVolume1 - productionQuantity;
             detail := product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := ifexpr( tempProductQuantity > 0 ,productionQuantity,singleShiftVolume1 ) ,SingleShiftName := "鐧界彮");
             singleShiftVolume1 := singleShiftVolume1 - productionQuantity;
             productionQuantity := productionQuantity - detail.ShiftVolume();
-          }else if(singleShiftVolume2 > 0 and productionQuantity > 0){
+          }
+          if(singleShiftVolume2 > 0 and productionQuantity > 0){
             tempProductQuantity := singleShiftVolume2 - productionQuantity;
             detail := product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := ifexpr( tempProductQuantity > 0 ,productionQuantity,singleShiftVolume2 ) ,SingleShiftName := "浜岀彮");
             singleShiftVolume2 := singleShiftVolume2 - productionQuantity;
             productionQuantity := productionQuantity - detail.ShiftVolume();
-          }else if(singleShiftVolume3 > 0 and productionQuantity > 0){
+          }
+          if(singleShiftVolume3 > 0 and productionQuantity > 0){
             tempProductQuantity := singleShiftVolume3 - productionQuantity;
-            detail := product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := ifexpr( tempProductQuantity > 0 ,productionQuantity,singleShiftVolume3 ) ,SingleShiftName := "浜岀彮");
+            detail := product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := ifexpr( tempProductQuantity > 0 ,productionQuantity,singleShiftVolume3 ) ,SingleShiftName := "涓夌彮");
             singleShiftVolume3 := singleShiftVolume3 - productionQuantity;
             productionQuantity := productionQuantity - detail.ShiftVolume();
           }
         }
         
-      }else if( line.ShiftName() = "2" ){    
+      }else if( (line.ShiftName() = "2") or (line.ShiftName() = "9+9") or (line.ShiftName() = "10+10") or (line.ShiftName() = "11+11") ){
         // 240.5
         singleShiftVolume1 := 0.0;
         singleShiftVolume2 := 0.0;
-        if( line.Remark().LikeUserLocale( "淇濆吇" )){
+        if( line.Tips().LikeUserLocale( "淇濆吇" )){
           singleShiftVolume1 := 0.0;
           singleShiftVolume2 := lineQuantity;
         }else{
@@ -202,8 +208,11 @@
     
         for( i := tempProducts.Size() - 1;i >= 0; i-- ){
           product := tempProducts.Element( i );
-          // 288
           productionQuantity := product.ProductionQuantity();
+          
+          if( line.Tips().LikeUserLocale( "淇濆吇" ) and productionQuantity > 0){
+            product.DispatchShiftSchedulingDetail( relnew,ShiftVolume := 0 ,SingleShiftName := "鐧界彮");
+          }
           
           if( singleShiftVolume1 > 0 and productionQuantity > 0){
             // -47.5
@@ -223,7 +232,7 @@
       }else if( line.ShiftName() = "1" ){
         singleShiftVolume1 := lineQuantity / 1;
         
-        if( line.Remark().LikeUserLocale( "淇濆吇" )){
+        if( line.Tips().LikeUserLocale( "淇濆吇" )){
           singleShiftVolume1 := lineQuantity / 1;
         }else{
           singleShiftVolume1 := lineQuantity / 1;
@@ -241,7 +250,7 @@
         }
         
       }else{
-        // singleShiftVolume := lineQuantity / 1;
+        
       }
     }
     

--
Gitblit v1.9.3