From 5be1a4f56ab08d96dfae922ef4eb2ce74a7fabeb Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期三, 13 九月 2023 10:55:09 +0800
Subject: [PATCH] Merge branch 'dev_release' into dev

---
 _Main/BL/Type_MacroPlan/Method_MappingOperationData.qbl |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationData.qbl
index a3a19ed..07e9838 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationData.qbl
@@ -11,8 +11,8 @@
     toDealList := construct( MappingOperations );
     if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) {
         toDealList := selectsortedset( this, MappingOperation, item, 
-    //                                   businessTypes.Find( item.BusinessType() ) >= 0, 
-                                       businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0, 
+                                       businessTypes.Find( item.BusinessType() ) >= 0, 
+    //                                   businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0, 
                                        item.SequenceNumber() );
     } else {
         toDealList := selectsortedset( this, MappingOperation, item, 
@@ -26,7 +26,7 @@
         routingId := item.OrganCode() + "_" + item.ProductID();
         unitId := item.OrganCode() + "_" + item.PlantName() + "_" + item.ProcessSection();
         routingStepName := item.ProcessSection() + "_" + [String]item.SequenceNumber();
-        operationId := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection();
+        operationId := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection()+"_" + [String]item.SequenceNumber();
     //    info( "========" )
     //    info( "routingId:" + routingId );
     //    info( "unitId:" + unitId );
@@ -51,15 +51,16 @@
         if( isnull( routingStep ) ) {
             routingStep := RoutingStep::Create( routing, routingStepName, "", true );
         }
-        // UnitOfMeasure
-        unitOfMeasure := UnitOfMeasure_MP::FindByName( this, item.UnitOfMeasureName() );
-        if( isnull( unitOfMeasure ) ) {
-            error( "unit of measure [" + item.UnitOfMeasureName() + "] not found for routing [" + routingId + "]" );
-        }
+        
         // Unit
         unit := Unit::FindById( this, unitId );
         if( isnull( unit ) ) {
-            unit := this.Unit( relnew, 
+          // UnitOfMeasure
+        unitOfMeasure := UnitOfMeasure_MP::FindByName( this, item.UnitOfMeasureName() );
+          if( isnull( unitOfMeasure ) ) {
+              info( "unit of measure [" + item.UnitOfMeasureName() + "] not found for routing [" + routingId + "]" );
+          }
+           unit := this.Unit( relnew, 
                               ID := unitId, Name := unitId, CapacityType := "Infinite",
                               DefaultGridX := 0, DefaultGridY := 0,
                               IsManuallyConfigured := false,

--
Gitblit v1.9.3