lihongji
2024-11-19 3d66f91917d7b1dbd1c6de29ccd0696ad1526713
BUG修复
已修改3个文件
45 ■■■■ 文件已修改
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SynchronizeToNewSupply.qbl
@@ -9,28 +9,25 @@
  TextBody:
  [*
    traverse ( selectedRows, Elements.NewOfflinePlanCell, cell, 
               cell.NewOfflinePlanRow().Type() = "1" and cell.Quantity() > 0.0
               cell.NewOfflinePlanRow().Type() = "1" and cell.Quantity() >= 0.0
    //           and cell.NewOfflinePlanRow().ProductionLine() = "eMotor Assy (France)" and cell.NewOfflinePlanColumn().StartDate() = Date::Construct( 2020, 4, 4 )
             ) 
    {
     pto := select( macroPlan, Unit.Operation.PeriodTaskOperation, tempPTO,
                    exists( tempPTO, NewSupply, tempNS, tempNS.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() = cell.NewOfflinePlanRow().ProductID() ) and
                    tempPTO.Operation().UnitID() = cell.NewOfflinePlanRow().ProductionLine()                                                                                                 and
                    tempPTO.Start().Date()       = cell.NewOfflinePlanColumn().StartDate() );
      if ( isnull( pto ) ) {
      pto := select( macroPlan, Unit.Operation.PeriodTaskOperation, tempPTO,
                     exists( tempPTO, NewSupply, tempNS, tempNS.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() = cell.NewOfflinePlanRow().ProductID() ) and
                     tempPTO.Operation().UnitID() = cell.NewOfflinePlanRow().ProductionLine()                                                                                                 and
                     tempPTO.Start().Date()       = cell.NewOfflinePlanColumn().StartDate() );
      if ( isnull( pto ) and cell.Quantity() > 0 ) {
        o  := select( macroPlan, Unit.Operation, tempO, tempO.ID() = cell.NewOfflinePlanRow().OperationID() );
        up := select( macroPlan, Unit.UnitPeriod, tempUP, tempUP.UnitID() = cell.NewOfflinePlanRow().ProductionLine() and tempUP.StartDate() = cell.NewOfflinePlanColumn().StartDate() );
        if ( not isnull( o ) and not isnull( up ) ) {
          PeriodTaskOperation::Create( o, up, cell.Quantity(), false );
        }
      } else {
      } else if ( not isnull( pto ) ) {
        if ( [Number]cell.Quantity() <> [Number]pto.Quantity() ) {
          pto.Update( cell.Quantity(), false );
        }
      }
      
    }
  *]
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateOrder.qbl
@@ -18,7 +18,16 @@
    
    if ( guard( [Number]value.SubString( 1, 2 ) <= 0, true ) ) {
      error( "不符合格式" );
    };
    }
    if ( exists( nopc, NewOfflinePlanColumn.NewOfflinePlanCell, tempNOPCell,
                 tempNOPCell                                      <> nopc                                      and
                 tempNOPCell.NewOfflinePlanRow().Type()           =  "1"                                       and
                 tempNOPCell.NewOfflinePlanRow().ProductionLine() =  nopc.NewOfflinePlanRow().ProductionLine(),
                 tempNOPCell.OrderNr() = [Number]value.SubString( 1, 2 ) )
        ) {
      error( "已经存在Order:", [Number]value.SubString( 1, 2 ) );
    }
    
    nopc.Order( value );
    nopc.OrderNr( [Number]value.SubString( 1, 2 ) );
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_UpdateQuantity.qbl
@@ -6,5 +6,20 @@
  String attrName
)
{
  TextBody: 'nopc.Quantity( value );'
  TextBody:
  [*
    if ( value < 0 ) {
      error( "数量不能为负" );
    }
    nopc.Quantity( value );
    // 数量为0,修改Order
    if ( value = 0 ) {
      nopc.Order( "" );
      nopc.OrderNr( 0 );
    }
    // 如果数量不为0,修改Order
  *]
}