renhao
2023-09-13 9e6cd153724264ff955d7e398c395db7a33f7e0d
external supply修改
product字段调整
已修改4个文件
已添加2个文件
62 ■■■■■ 文件已修改
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Product_MP/Attribute_BusinessTypeCommon.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Product_MP/Attribute_KeyProduct.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Product_MP/StaticMethod_CreateOrUpdate.qbl 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
@@ -9,8 +9,9 @@
  [*
    // renhao Aug-14-2023 (created)
    
    listtodeal := selectset( this,MappingExternalSupply,externalSupply, true );
    listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 );
    totalcount := listtodeal.Size();
    description := "在途在制";
    info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" );
    
    count := 0;
@@ -19,10 +20,11 @@
      if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
        info( "Now is dealing with the " + count.AsQUILL() + "ExternalSupply " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
        }
      product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID() and product.KeyProduct() = nuclear,true);
      product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID(),true);
      
      if( not isnull( product)){
        productMP :=  select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true);
        productMP :=  Product_MP :: FindProductTypeIndex( externalSupply.ProductID());
        stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true);
        if( not isnull(businessTypes)){
        
@@ -34,25 +36,25 @@
                                               stockingpoint,
                                               externalSupply.Date(),
                                               externalSupply.ManufacturedDate(),
                                               externalSupply.UserQuantity(),"在途在制");
                                               externalSupply.UserQuantity(),description);
            }
          }
          
        }else{
        if( not isnull( stockingpoint) and not isnull( productMP)){
          InventorySupply::CreateOrUpdate( externalSupply.ID(),
          if( not isnull( stockingpoint) and not isnull( productMP)){
            InventorySupply::CreateOrUpdate( externalSupply.ID(),
                                           productMP,
                                           stockingpoint,
                                           externalSupply.Date(),
                                           externalSupply.ManufacturedDate(),
                                           externalSupply.UserQuantity(),"在途在制");
        }
                                           externalSupply.UserQuantity(),description);
          }
      
        }
        
      }else{
        info( "Invaild product" );
        }
      }
    }
  *]
}
_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -27,7 +27,7 @@
                          moperation.ProductID() = item.ProductID(), 
                          moperation.SequenceNumber() ).SequenceNumber()
      if( item.SequenceNumber() = maxsn ){
        listtodealwithmaxsn.Add( item );
          listtodealwithmaxsn.Add( item );
        }
      }
    
_Main/BL/Type_MacroPlan/Method_MappingProductData.qbl
@@ -23,9 +23,9 @@
    } else {
        if( iskeyproduct = true ){
          listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true,  businesstypes.Find(  item.BusinessType()) > 0 );
          }
         }
        else{
        listToDeal := selectset( this, MappingProduct, item, businesstypes.Find(  item.BusinessType()) > 0 );
          listToDeal := selectset( this, MappingProduct, item, businesstypes.Find(  item.BusinessType()) > 0 );
        }
    }
    totalcount := listToDeal.Size();
@@ -38,7 +38,7 @@
                                "全部物料产品", 
                                "PCS", 
                                "全部物料产品",
                                0.0
                                0.0,false,false
                                );
    count := 0;
    // Get the ProductMajorType list & ProductSubclassType list
@@ -54,7 +54,7 @@
                                    item.ProductMajorType(), 
                                    "PCS", 
                                    item.ProductMajorType(),
                                    0.0
                                    0.0,false,false
                                    );
      }
      productmajortype := item.ProductMajorType();
@@ -69,12 +69,12 @@
                                    item.ProductSubclassType(), 
                                    "PCS", 
                                    item.ProductSubclassType(),
                                    0.0
                                    0.0,false,false
                                    );
        }
      productsubclasstype := item.ProductSubclassType();
      if( productsubclasstype="" ){
        productsubclasstype := productmajortype;
          productsubclasstype := productmajortype;
        }
      
      if( not item.ID() = "" ){
@@ -84,7 +84,8 @@
                                      item.ID(), 
                                      item.UnitOfMeasureName(), 
                                      item.Name(),
                                      item.ShelfLife()
                                      item.ShelfLife(),
                                      item.KeyProduct(),item.IsCommon()
                                      );
        }
      }
_Main/BL/Type_Product_MP/Attribute_BusinessTypeCommon.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute BusinessTypeCommon
{
  #keys: '3[414480.0.138606036][414480.0.138606035][414480.0.138606037]'
  ValueType: Boolean
}
_Main/BL/Type_Product_MP/Attribute_KeyProduct.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute KeyProduct
{
  #keys: '3[414480.0.138606008][414480.0.138606007][414480.0.138606009]'
  ValueType: Boolean
}
_Main/BL/Type_Product_MP/StaticMethod_CreateOrUpdate.qbl
@@ -7,7 +7,9 @@
  String name,
  String unitofmeasurename,
  String description,
  Real shelflife
  Real shelflife,
  Boolean keyproduct,
  Boolean businesstypecommon
)
{
  TextBody:
@@ -28,7 +30,7 @@
    //info( productid );
    
    if( isnull( product ) ){
      Product_MP::Create( owner,
      product := Product_MP::Create( owner,
                          productid, 
                          parentid, 
                          name, 
@@ -44,6 +46,9 @@
                          isexcludedfromfulfilmentkpis, 
                          isfromdb
                          );
        product.KeyProduct(keyproduct);
        product.BusinessTypeCommon(businesstypecommon);
      }else{
        product.Update( productid, 
                        name, 
@@ -60,6 +65,8 @@
                        isexcludedfromfulfilmentkpis, 
                        isfromdb
                        );
          product.KeyProduct(keyproduct);
          product.BusinessTypeCommon(businesstypecommon);
        }
  *]
}