admin
2024-10-20 6a9c7ad8915554e72e22fea43e05fa10dbd9b36d
调拨整班优化
已修改2个文件
32 ■■■■■ 文件已修改
_Main/BL/Type_Unit/Method_WholeShiftFiltering.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_WholeShift/Method_IsRoundingOrZeroFilling4.qbl 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Unit/Method_WholeShiftFiltering.qbl
@@ -2,5 +2,5 @@
#parent: #root
Method WholeShiftFiltering () declarative remote as Boolean
{
  TextBody: 'return this.HasCapacityTypeTime() or this.HasCapacityTypeTransportQuantity();'
  TextBody: 'return this.HasCapacityTypeTime() or ( this.HasCapacityTypeTransportQuantity() and this.Name().Regex( "Transport" ) );'
}
_Main/BL/Type_WholeShift/Method_IsRoundingOrZeroFilling4.qbl
@@ -8,27 +8,17 @@
  Description: '车道整班'
  TextBody:
  [*
    traverse ( unit, Lane.LaneLeg.Trip, t ) {
      traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 ) {
        info( pit.Product_MP().ParentID() );
        // 获取产品lotsize倍数
        lotsize := 1;
        if ( pit.Product_MP().ParentID().Regex( "ZKG" ) ) {
          lotsize := macroPlan.CylinderBlock();
        } else if ( pit.Product_MP().ParentID().Regex( "ZKM" ) ) {
          lotsize := macroPlan.CylinderHead();
        } else if ( pit.Product_MP().ParentID().Regex( "PL" ) ) {
          lotsize := macroPlan.ConnectingRod();
        } else if ( pit.Product_MP().ParentID().Regex( "KW" ) ) {
          lotsize := macroPlan.Crankshaft();
        } else if ( pit.Product_MP().ParentID().Regex( "AGW" ) ) {
          lotsize := macroPlan.BalanceAxis();
        }
    us  := unit.Name().Tokenize( " " );
    tmq := select( macroPlan, TransferMinimumQuantity, tempTMQ, tempTMQ.FactoryAbbreviation() = us.Element( 0 ) and tempTMQ.ProductID() = us.Element( 3 ) );
        
        if ( lotsize > 1 ) {
          debuginfo( "产品ID:", pit.ProductID(), "    产品数量:", pit.Quantity(), "    lotsize:", lotsize );
          quantityToBeSupplemented := lotsize - ( pit.Quantity() mod lotsize );
          pit.Update( pit.Quantity() + quantityToBeSupplemented, true );
    if ( not isnull( tmq ) ) {
    //  info( "最小包装lotsize:", tmq.Quantity() );
      traverse ( unit, Lane.LaneLeg.Trip, t ) {
        needRoundTransferQuantity := tmq.Quantity() - ( [Number]t.Quantity() mod tmq.Quantity() );
        if ( needRoundTransferQuantity <> 0 and needRoundTransferQuantity <> tmq.Quantity() ) {
    //      info( "时间:", t.Departure().Date().Format( "Y-M2-D2" ), "    余数:", needRoundTransferQuantity );
          pit := minselect( t, ProductInTrip, tempPIT, tempPIT.Quantity() > 0, tempPIT.Quantity() );
          pit.Update( pit.Quantity() + needRoundTransferQuantity, true );
        }
      }
    }