lazhen
2024-11-15 88d76519ae0a139a0b9e48008f60e7362007c565
_Main/BL/Type_PackagingPlanCell/Method_UpdateValue.qbl
@@ -15,22 +15,36 @@
     this.Unpacking( value );
    }
    
    if ( attrName = "Out" ) { // 调出
      unitID := ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "DL to CC", "CC to DL" ) + " " + this.PackagingPlanRow().Category() + " Transport";
    if ( this.PackagingPlanRow().Factory() = "长春工厂" and ( attrName = "Package" or attrName = "Unpacking" ) ) {
      u := select( this.PackagingPlanRow().MacroPlan(), Unit, tempU, tempU.ID() = "CC " + this.PackagingPlanRow().Category() + " 线边和外租库间" );
      
      pit     := select( this.PackagingPlanRow().MacroPlan(), Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                         tempPIT.Trip().LaneLeg().Lane().UnitID() = unitID                                 and
                         tempPIT.Trip().Departure().Date()        = this.PackagingPlanColumn().StartDate() and
                         tempPIT.ProductID()                      = this.PackagingPlanRow().ProductID() );
      t := select( u, Lane.LaneLeg.Trip, tempT, tempT.Departure().Date() = this.PackagingPlanColumn().StartDate() and
                   ifexpr( attrName = "Package",
                           tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" ) and tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" ),
                           tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "外租库" ) and tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "线边库" ) )
                  );
      pit := select( t, ProductInTrip, tempPIT, tempPIT.ProductID() = this.PackagingPlanRow().ProductID() );
      pit.Update( value, true );
      this.Out( value );
      cell := select( this.PackagingPlanRow().MacroPlan(), PackagingPlanRow.PackagingPlanCell, tempPPCell,
                      tempPPCell.PackagingPlanRow().Factory()      = ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "长春工厂", "大连工厂" ) and
                      tempPPCell.PackagingPlanRow().ProductID()    = this.PackagingPlanRow().ProductID()                                              and
                      tempPPCell.PackagingPlanColumn().StartDate() = pit.Trip().Arrival().Date() );
      cell.TransferIn( value );
    }
    //if ( attrName = "Out" ) { // 调出
    //  unitID := ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "DL to CC", "CC to DL" ) + " " + this.PackagingPlanRow().Category() + " Transport";
    //
    //  pit     := select( this.PackagingPlanRow().MacroPlan(), Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
    //                     tempPIT.Trip().LaneLeg().Lane().UnitID() = unitID                                 and
    //                     tempPIT.Trip().Departure().Date()        = this.PackagingPlanColumn().StartDate() and
    //                     tempPIT.ProductID()                      = this.PackagingPlanRow().ProductID() );
    //
    //  pit.Update( value, true );
    //  this.Out( value );
    //
    //  cell := select( this.PackagingPlanRow().MacroPlan(), PackagingPlanRow.PackagingPlanCell, tempPPCell,
    //                  tempPPCell.PackagingPlanRow().Factory()      = ifexpr( this.PackagingPlanRow().Factory() = "大连工厂", "长春工厂", "大连工厂" ) and
    //                  tempPPCell.PackagingPlanRow().ProductID()    = this.PackagingPlanRow().ProductID()                                              and
    //                  tempPPCell.PackagingPlanColumn().StartDate() = pit.Trip().Arrival().Date() );
    //  cell.TransferIn( value );
    //}
  *]
}