From 3cb5a54def670d97301f07170fcaad213bfc54f2 Mon Sep 17 00:00:00 2001
From: yypsybs <yypsybs@foxmail.com>
Date: 星期六, 09 九月 2023 15:30:46 +0800
Subject: [PATCH] 同步逻辑由MacroPlan移到MPSync

---
 _Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl |  104 ++++++++++++++++++++++++++--------------------------
 1 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
index 3a315d0..061336f 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -7,57 +7,57 @@
   Description: 'Get operation cost data from operation mapping'
   TextBody:
   [*
-    // Administrator Aug-21-2023 (created)
-    // list to deal
-    listtodeal := construct( structured[MappingOperation] );
-    
-    if( isnull( businesstypes ) or businesstypes.Size() = 0 ) {
-        listtodeal := selectset( this, MappingOperation, item, true );
-    } else {
-        listtodeal := selectset( this, MappingOperation, item, businesstypes.Find( item.BusinessType() ) <> -1 );
-    }
-    
-    // Get the list to deal with max sequence number
-    listtodealwithmaxsn := construct( structured[MappingOperation] );
-    traverse( listtodeal, Elements, item ){
-      maxsn := maxselect( this, 
-                          MappingOperation, 
-                          moperation, 
-                          moperation.OrganCode() = item.OrganCode(), 
-                          moperation.ProductID() = item.ProductID(), 
-                          moperation.SequenceNumber() ).SequenceNumber()
-      if( item.SequenceNumber() = maxsn ){
-        listtodealwithmaxsn.Add( item );
-        }
-      }
-    
-    totalcount := listtodealwithmaxsn.Size();
-    info( "OperationCost has " + totalcount.AsQUILL() + " rows in total" );
-    
-    count := 0;
-    // Get the operation cost data
-    traverse( listtodealwithmaxsn, Elements, item ){
-      count := count + 1;
-      if( count - [Number](count/100) * 100 = 0 or count = totalcount ){
-        info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
-        }
-      id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection() + "_" + item.Line();
-      operation := Operation::FindOperationTypeIndex( id );
-      account := Account_MP::FindByName( this, "Operation cost" );
-      isfromdb := false;
-      existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
-      if( isnull( existoperationcost ) ){
-        connecteditem := select( this, 
-                                 MappingOperationCost, 
-                                 moperationcost, 
-                                 moperationcost.OrgCode() = item.OrganCode(), 
-                                 moperationcost.ProductID() = item.ProductID() );
-        cost := connecteditem.Cost();
-        lengthoftime := connecteditem.LengthOfTime();
-        start := connecteditem.Start();
-        timeunit := connecteditem.TimeUnit();
-        OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
-        }
-      }
+    //// Administrator Aug-21-2023 (created)
+    //// list to deal
+    //listtodeal := construct( structured[MappingOperation] );
+    //
+    //if( isnull( businesstypes ) or businesstypes.Size() = 0 ) {
+    //    listtodeal := selectset( this, MappingOperation, item, true );
+    //} else {
+    //    listtodeal := selectset( this, MappingOperation, item, businesstypes.Find( item.BusinessType() ) <> -1 );
+    //}
+    //
+    //// Get the list to deal with max sequence number
+    //listtodealwithmaxsn := construct( structured[MappingOperation] );
+    //traverse( listtodeal, Elements, item ){
+    //  maxsn := maxselect( this, 
+    //                      MappingOperation, 
+    //                      moperation, 
+    //                      moperation.OrganCode() = item.OrganCode(), 
+    //                      moperation.ProductID() = item.ProductID(), 
+    //                      moperation.SequenceNumber() ).SequenceNumber()
+    //  if( item.SequenceNumber() = maxsn ){
+    //    listtodealwithmaxsn.Add( item );
+    //    }
+    //  }
+    //
+    //totalcount := listtodealwithmaxsn.Size();
+    //info( "OperationCost has " + totalcount.AsQUILL() + " rows in total" );
+    //
+    //count := 0;
+    //// Get the operation cost data
+    //traverse( listtodealwithmaxsn, Elements, item ){
+    //  count := count + 1;
+    //  if( count - [Number](count/100) * 100 = 0 or count = totalcount ){
+    //    info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
+    //    }
+    //  id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection() + "_" + item.Line();
+    //  operation := Operation::FindOperationTypeIndex( id );
+    //  account := Account_MP::FindByName( this, "Operation cost" );
+    //  isfromdb := false;
+    //  existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
+    //  if( isnull( existoperationcost ) ){
+    //    connecteditem := select( this, 
+    //                             MappingOperationCost, 
+    //                             moperationcost, 
+    //                             moperationcost.OrgCode() = item.OrganCode(), 
+    //                             moperationcost.ProductID() = item.ProductID() );
+    //    cost := connecteditem.Cost();
+    //    lengthoftime := connecteditem.LengthOfTime();
+    //    start := connecteditem.Start();
+    //    timeunit := connecteditem.TimeUnit();
+    //    OperationCost::Create( id, operation, account, "Volume", start, timeunit, lengthoftime, cost, isfromdb );
+    //    }
+    //  }
   *]
 }

--
Gitblit v1.9.3