hongji.li
2023-10-25 af73f90f5dbcd379e1be72144f281ca26958b41f
_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();