From 6a2cca9e802a0c7ed5716fea396911871deb4306 Mon Sep 17 00:00:00 2001
From: renhao <renhui.hao@capgemini.com>
Date: 星期二, 24 十月 2023 16:47:22 +0800
Subject: [PATCH] 在异步场景分发数据时 1 createPurchase参数创建判断逻辑 2 SOP场景的Product只取关键物料 3 unit的工艺段默认无限产能 4 运输单元修改层级

---
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingProductData.qbl      |    4 ++--
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingOperationBOMData.qbl |   11 +++++++++--
 _Main/BL/Type_MacroPlan/Method_DoASyncMappingUnitData.qbl         |    6 +++---
 _Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl            |   17 ++++++++---------
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl b/_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl
index 0c19698..060eabc 100644
--- a/_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl
+++ b/_Main/BL/Type_Lane/StaticMethod_CreateLaneFromJson.qbl
@@ -16,7 +16,6 @@
     processingtime := Duration::Zero();
     
     unitofmeasurename := "PCS";
-    currencyid := "CNY";
     startdate := Date::Date( 1900, 1, 1 );
     enddate := Date::Date( 9999, 12, 31 );
     capacitytype := "Transport quantity";
@@ -31,14 +30,14 @@
     
     unit := Unit::FindUnitTypeIndex( unitid );
     if( isnull( unit)){
-      unit :=macroplan.Unit( relnew, 
-                 ID := unitid, 
-                 Name := unitid, 
-                 UnitOfMeasureName := unitofmeasurename, 
-                 CurrencyID := currencyid, 
-                 StartDate := startdate, 
-                 EndDate := enddate, 
-                 CapacityType := capacitytype );
+      unit := macroplan.Unit( relnew, ID := unitid, 
+                   Name := unitid, 
+                   ParentUnitID := "杩愯緭", 
+                   CapacityType := capacitytype, 
+                   UnitOfMeasureName := unitofmeasurename,
+                   CurrencyID := macroplan.BaseCurrency().ID(), 
+                   StartDate := startdate, 
+                   EndDate := enddate );
     }
     
     result := Lane::CreateLane( unit, id, name, processingtime);
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingOperationBOMData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingOperationBOMData.qbl
index 8c1a8e4..c7fe0d5 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingOperationBOMData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingOperationBOMData.qbl
@@ -13,7 +13,7 @@
     // yypsybs Aug-21-2023 (created)
     keyProductList := construct( Strings );
     if( isKeyProduct ) {
-        keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="鎴愬搧" or item.ProductMajorType()="鍗婃垚鍝�", item.ID() );
+       keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="鎴愬搧" or item.ProductMajorType()="鍗婃垚鍝�", item.ID() );
     }
     bomList := selectsortedset(  globalOTDTable, Global_MappingOperationBOM, item,
                                  ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, 
@@ -75,8 +75,15 @@
         }
     }
     if( createPurchaseSupplyMaterial ) {
-        toCreateBomList := selectuniquevalues( bomList, Elements, item, 
+      toCreateBomList := construct( Strings );
+      if( isKeyProduct){
+          toCreateBomList := selectuniquevalues( bomList, Elements, item, 
                                                item.ComponentType() = "P" and keyProductList.Find( item.ComponentCode())>=0, item.OrganCode() + item.ComponentCode());
+        }else{
+          toCreateBomList := selectuniquevalues( bomList, Elements, item, 
+                                               item.ComponentType() = "P" , item.OrganCode() + item.ComponentCode());
+        
+          }
         traverse( toCreateBomList, Elements, key ) {
             boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key );
             bom := boms.First();
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductData.qbl
index 55562f4..8b44c13 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingProductData.qbl
@@ -16,14 +16,14 @@
     
     if( isnull( businesstypes ) or businesstypes.Size() = 0 ) {
         if( iskeyproduct = true ){
-          listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true );
+          listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="鎴愬搧" or item.ProductMajorType()="鍗婃垚鍝�" );
           }
         else{
           listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, true );
           }
     } else {
         if( iskeyproduct = true ){
-          listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true and businesstypes.Find( item.BusinessType() ) >= 0 );
+          listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, (item.ProductMajorType()="鎴愬搧" or item.ProductMajorType()="鍗婃垚鍝�") and businesstypes.Find( item.BusinessType() ) >= 0 );
          }
         else{
           listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, businesstypes.Find( item.BusinessType() ) >= 0 );
diff --git a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingUnitData.qbl b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingUnitData.qbl
index 171448e..1407447 100644
--- a/_Main/BL/Type_MacroPlan/Method_DoASyncMappingUnitData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_DoASyncMappingUnitData.qbl
@@ -53,8 +53,8 @@
     supplyunit.IsSupplier(true);
     
     Unit::CreateOrUpdate( this, 
-                          "鏁磋溅杩愯緭", 
-                          "鏁磋溅杩愯緭", 
+                          "杩愯緭", 
+                          "杩愯緭", 
                           "澶╅┈闆嗗洟", 
                           capacitytype, 
                           unitofmeasurename );
@@ -88,7 +88,7 @@
                             thirdlevelid, 
                             thirdlevelid, 
                             secondlevelid, 
-                            "Time", 
+                            infinite, 
                             item.UnitOfMeasureName() );
                    
       //Get the last level unit

--
Gitblit v1.9.3