lazhen
2024-10-14 133f1a1dc59bbf13a35dc3d64e2ddaf6b37a335f
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
@@ -2,6 +2,7 @@
#parent: #root
StaticMethod Compared (
  RecycleBin recycleBin,
  const MacroPlan mactoPlan,
  String baseVersionPath,
  String compareVersionPath,
  String baseVersionName,
@@ -12,6 +13,17 @@
  [*
    // rislai Jun-20-2024 (created)
    localTable := recycleBin.LocalTable( relnew,Name := baseVersionName + "__" + compareVersionName );
    products := selectset( mactoPlan,Product_MP,product,not product.IsSystem() and product.IsUsed() );
    productIndexTree := NamedValueTree::Create();
    try{
      for( i := 0; i < products.Size(); i++){
        product := products.Element( i );
        productHandle := productIndexTree.GetHandle( product.Notes() );
        productIndexTree.Root().AddChild( productHandle,i )
      }
    }onerror{}
    
    baseVersionFile := OSFile::Construct();
    compareVersionFile := OSFile::Construct();
@@ -88,7 +100,17 @@
                             CompareVersionValue := ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()));
              column.IsAttrbuteColumn( true );
              if( columnName = "发动机零件号" ){
                row.ProductID( ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value()) );
                productID := ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value());
                productHanlde := productIndexTree.GetHandle( productID );
                productIndex := guard( productIndexTree.Root().Child( productHanlde ), null( NamedValue ));
                if( not isnull( productIndex )){
                  product := products.Element( productIndex.GetValueAsNumber() );
                  productID := product.ID();
                }
                row.ProductID( productID );
              }
              if( columnName = "车型" ){
                row.CustomName( " > " + ifexpr( isnull( baseVersionCell ), ifexpr( isnull( compareVersionCell ),"空",compareVersionCell.Value()), baseVersionCell.Value()) );