limj
2023-09-15 e6c0b43a4f21923ceeee5f9c35650314fc783962
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
@@ -17,7 +17,8 @@
    bomList := selectsortedset(  this, MappingBOM, item,
                                 ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, 
                                         true, 
                                         businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 )
    //                                     businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 )
                                         businessTypes.Find( item.BusinessType() ) >= 0 )
                                 and ifexpr( isKeyProduct, 
                                             keyProductList.Size() > 0 and keyProductList.Find( item.ComponentCode() ) >= 0,
                                             true ),
@@ -28,19 +29,19 @@
        routingRows := selectset( bomList, Elements, item, true, routingId = item.OrganCode() + "_" + item.ProductCode() );
        if( routingRows.Size() > 0 ) {
            firstRow := routingRows.Element( 0 );
            stockingPointId := firstRow.OrganCode()  + "_" + firstRow.ProductType() + "_STOCK";
            inputStockingPointId := firstRow.OrganCode()  + "_" + firstRow.ComponentType() + "_STOCK";
            stockingPointId := firstRow.OrganCode()  + "_" + firstRow.ProductType() + "_Stock";
            inputStockingPointId := firstRow.OrganCode()  + "_" + firstRow.ComponentType() + "_Stock";
            // ========检查========
            product := Product_MP::FindById( this, firstRow.ProductCode() );
            product := Product_MP::FindProductTypeIndex( firstRow.ProductCode() );
            if( not isnull( product ) ) {
    //              error( "product : " + firstRow.ProductCode() + " not found" );
              stockingPoint := StockingPoint_MP::FindById( this, stockingPointId );
              inputStockingPoint := StockingPoint_MP::FindById( this, inputStockingPointId );
              stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( stockingPointId );
              inputStockingPoint := StockingPoint_MP::FindStockingPointTypeIndex(  inputStockingPointId );
    //          info( stockingPointId.AsQUILL() );
      //        if( isnull( stockingPoint ) ) {
      //            error( "stockingPoint : " + stockingPointId + " not found" );
      //        }
              routing := Routing::FindById( this, routingId );
              routing := Routing::FindRoutingTypeIndex(  routingId );
              if( not isnull( routing ) ) {
    //              error( "routing : " + routingId + " not found" );
                // ========处理输出========