From 1811d693013942d9b2e61ca4b04b7a8500a4e047 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 20 十一月 2024 11:40:03 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg

---
 _Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl             |   17 ++++++++++++++++-
 _Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl     |   17 +++++++----------
 _Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl                |   11 ++++++++++-
 _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchCC.qbl |    2 +-
 _Main/BL/Type_LockPeriod/Method_Enable.qbl                                   |    1 +
 _Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchDL.qbl |    2 +-
 6 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchCC.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchCC.qbl
index 965aa8d..1ac9bef 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchCC.qbl
+++ b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchCC.qbl
@@ -26,7 +26,7 @@
       traverse( product,DispatchShiftSchedulingDetail,detail ){
         detail_Json := JSON::Object();
         detail_Json.Add( "ShiftName",detail.SingleShiftName() );
-        detail_Json.Add( "Quantity",detail.ShiftVolume() );
+        detail_Json.Add( "Quantity",detail.ShiftVolume().Format( "N(Dec)" ) );
         detail_Json.Add( "ProductNo",detail.DispatchShiftSchedulingProduct().ProductID() );
         
         details_Json.Add( detail_Json );
diff --git a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchDL.qbl b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchDL.qbl
index 21505a4..4fee584 100644
--- a/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchDL.qbl
+++ b/_Main/BL/Type_DispatchShiftSchedulingInformation/StaticMethod_DispatchDL.qbl
@@ -26,7 +26,7 @@
       traverse( product,DispatchShiftSchedulingDetail,detail ){
         detail_Json := JSON::Object();
         detail_Json.Add( "ShiftName",detail.SingleShiftName() );
-        detail_Json.Add( "Quantity",detail.ShiftVolume() );
+        detail_Json.Add( "Quantity",detail.ShiftVolume().Format( "N(Dec)" ) );
         detail_Json.Add( "ProductNo",detail.DispatchShiftSchedulingProduct().ProductID() );
         
         details_Json.Add( detail_Json );
diff --git a/_Main/BL/Type_LockPeriod/Method_Enable.qbl b/_Main/BL/Type_LockPeriod/Method_Enable.qbl
index 8582f7c..e8e9bf5 100644
--- a/_Main/BL/Type_LockPeriod/Method_Enable.qbl
+++ b/_Main/BL/Type_LockPeriod/Method_Enable.qbl
@@ -30,6 +30,7 @@
           offlinePlanCell := offlinePlanCells.Element( offlinePlanCellIndex.GetValueAsNumber() );
           offlinePlanCellQuantity := offlinePlanCell.Quantity();
         }
+    
         if( element.NewSupply( relsize ) = 1 ){
           traverse( element,NewSupply,newSupply ){
             newSupply.Update( offlinePlanCellQuantity );
diff --git a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl
index 4c521e8..d00ed54 100644
--- a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl
+++ b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl
@@ -9,28 +9,25 @@
   TextBody:
   [*
     traverse ( selectedRows, Elements.NewOfflinePlanCell, cell, 
-               cell.NewOfflinePlanRow().Type() = "1" and cell.Quantity() > 0.0 
+               cell.NewOfflinePlanRow().Type() = "1" and cell.Quantity() >= 0.0 
     //           and cell.NewOfflinePlanRow().ProductionLine() = "eMotor Assy (France)" and cell.NewOfflinePlanColumn().StartDate() = Date::Construct( 2020, 4, 4 )
              ) 
     {
-     pto := select( macroPlan, Unit.Operation.PeriodTaskOperation, tempPTO,
-                    exists( tempPTO, NewSupply, tempNS, tempNS.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() = cell.NewOfflinePlanRow().ProductID() ) and
-                    tempPTO.Operation().UnitID() = cell.NewOfflinePlanRow().ProductionLine()                                                                                                 and
-                    tempPTO.Start().Date()       = cell.NewOfflinePlanColumn().StartDate() );
-      if ( isnull( pto ) ) {
+      pto := select( macroPlan, Unit.Operation.PeriodTaskOperation, tempPTO,
+                     exists( tempPTO, NewSupply, tempNS, tempNS.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() = cell.NewOfflinePlanRow().ProductID() ) and
+                     tempPTO.Operation().UnitID() = cell.NewOfflinePlanRow().ProductionLine()                                                                                                 and
+                     tempPTO.Start().Date()       = cell.NewOfflinePlanColumn().StartDate() );
+      if ( isnull( pto ) and cell.Quantity() > 0 ) {
         o  := select( macroPlan, Unit.Operation, tempO, tempO.ID() = cell.NewOfflinePlanRow().OperationID() );
         up := select( macroPlan, Unit.UnitPeriod, tempUP, tempUP.UnitID() = cell.NewOfflinePlanRow().ProductionLine() and tempUP.StartDate() = cell.NewOfflinePlanColumn().StartDate() );
         if ( not isnull( o ) and not isnull( up ) ) {
           PeriodTaskOperation::Create( o, up, cell.Quantity(), false );
         }
-      } else {
+      } else if ( not isnull( pto ) ) {
         if ( [Number]cell.Quantity() <> [Number]pto.Quantity() ) {
           pto.Update( cell.Quantity(), false );
         }
       }
-      
-      
-      
       
     }
   *]
diff --git a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl
index 987530c..67fd195 100644
--- a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl
+++ b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl
@@ -18,7 +18,16 @@
     
     if ( guard( [Number]value.SubString( 1, 2 ) <= 0, true ) ) {
       error( "涓嶇鍚堟牸寮�" );
-    };
+    }
+    
+    if ( exists( nopc, NewOfflinePlanColumn.NewOfflinePlanCell, tempNOPCell, 
+                 tempNOPCell                                      <> nopc                                      and
+                 tempNOPCell.NewOfflinePlanRow().Type()           =  "1"                                       and
+                 tempNOPCell.NewOfflinePlanRow().ProductionLine() =  nopc.NewOfflinePlanRow().ProductionLine(),
+                 tempNOPCell.OrderNr() = [Number]value.SubString( 1, 2 ) ) 
+        ) {
+      error( "宸茬粡瀛樺湪Order锛�", [Number]value.SubString( 1, 2 ) );
+    }
     
     nopc.Order( value );
     nopc.OrderNr( [Number]value.SubString( 1, 2 ) );
diff --git a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl
index 7e82739..9dde79f 100644
--- a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl
+++ b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl
@@ -6,5 +6,20 @@
   String attrName
 )
 {
-  TextBody: 'nopc.Quantity( value );'
+  TextBody:
+  [*
+    if ( value < 0 ) {
+      error( "鏁伴噺涓嶈兘涓鸿礋" );
+    }
+    
+    nopc.Quantity( value );
+    
+    // 鏁伴噺涓�0锛屼慨鏀筄rder
+    if ( value = 0 ) {
+      nopc.Order( "" );
+      nopc.OrderNr( 0 );
+    }
+    
+    // 濡傛灉鏁伴噺涓嶄负0锛屼慨鏀筄rder
+  *]
 }

--
Gitblit v1.9.3