lazhen
2024-10-10 ae3b7f21551deb0e163eb5dbd4bea0a70bd54c50
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl
@@ -14,7 +14,12 @@
    // 生成调拨计划
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTransportQuantity() ) {
      traverse ( u, Lane.LaneLeg.Trip, t ) {
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 and exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" ) ) {
        originFactory      := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() );      // 起始工厂
        destinationFactory := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ); // 目标工厂
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0                                           and // 数量大于0
                   exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" )          and // 只取机加件
                   originFactory                                                   <> destinationFactory     // 起始工厂不能和目标工厂一致
                  ) {
          // 找行
          tpr := TransferPlanRow::FindTransferPlanRowTypeIndex( TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ),
                                                                TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ),