lazhen
2024-09-18 417f02834f331ea468d87add2a6143597c83648b
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已添加2个文件
已修改4个文件
92 ■■■■■ 文件已修改
_Main/BL/Type_OfflinePlanCell/StaticMethod_DeductionOfReplacementLoss.qbl 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_OfflinePlanRow/Method_Filter.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_MatrixEditor951.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_pHeader.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_pHeader_bDeductionOfReplacementLoss_OnClick.def 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_OfflinePlanCell/StaticMethod_DeductionOfReplacementLoss.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
Quintiq file version 2.0
#parent: #root
StaticMethod DeductionOfReplacementLoss (
  MacroPlan macroPlan,
  OfflinePlanTable opt
)
{
  TextBody:
  [*
    // ä¿å­˜ä¸Šä¸€ä»½å­˜æ¡£
    newOPT := OfflinePlanCell::SaveAsDraft( macroPlan, opt );
    // æ‰§è¡Œæ¢åž‹æŸå¤±
    allProductionLines := selectuniquevalues( newOPT, OfflinePlanRow, tempORR, true, tempORR.ProductionLine() );
    traverse ( allProductionLines, Elements, pl ) {
      oprs := selectset( newOPT, OfflinePlanRow, tempORT, tempORT.ProductionLine() = pl and ( tempORT.Type() = "1" or tempORT.Type() = "2" ) );
      traverse ( newOPT, OfflinePlanColumn, opc, opc.ColumnDate() = macroPlan.StartOfPlanning().Date() ) {
        for ( i := 1; i < 10; i++ ) {
          firstOrderCell  := select( oprs, Elements.OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc and tempOPC.Value() = ( "#" + i.Format( "N(LPad0(2))" ) ) );
          secondOrderCell := select( oprs, Elements.OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc and tempOPC.Value() = ( "#" + ( i + 1 ).Format( "N(LPad0(2))" ) ) );
          // æ¢åž‹æŸå¤±å‚æ•°
          cls        := select( macroPlan, ChangeLossSetting, tempCLS,
                                guard( tempCLS.ProductFirst().ID()  = firstOrderCell.OfflinePlanRow().ProductID() , false ) and
                                guard( tempCLS.ProductSecond().ID() = secondOrderCell.OfflinePlanRow().ProductID(), false ) and
                                guard( tempCLS.StartDate()          <= opc.ColumnDate()                           , false ) and
                                guard( tempCLS.EndDate()            >= opc.ColumnDate()                           , false )
                               );
          if ( not isnull( firstOrderCell ) and not isnull( secondOrderCell ) and not isnull( cls ) ) {
            firstQuantityCell := select( oprs, Elements.OfflinePlanCell, tempOPC,
                                         tempOPC.OfflinePlanColumn() = opc     and
                                         tempOPC.OfflinePlanRow().Type() = "1" and
                                         tempOPC.OfflinePlanRow().ProductID() = firstOrderCell.OfflinePlanRow().ProductID()
                                        );
            firstQuantityCell.Value( [String] ( [Number]firstQuantityCell.Value() - cls.ChangeLossNr() ) );
    //        info( "当前序号:", i, "    å•元格的值:", firstCell.Value(), "    äº§å“åï¼š", firstCell.OfflinePlanRow().ProductID(),
    //              "下一个序号:", i + 1, "    å•元格的值:", secondCell.Value(), "    äº§å“åï¼š", secondCell.OfflinePlanRow().ProductID() );
          }
        }
      }
    }
    // é‡ç½®æ€»è®¡è¡Œ
    totalOPRs := selectset( newOPT, OfflinePlanRow, tempOPR, tempOPR.Type() = "3" );
    traverse ( newOPT, OfflinePlanColumn, opc, opc.OfflinePlanCell( relsize ) > 0 and opc.ColumnDate() >= macroPlan.StartOfPlanning().Date() ) {
      traverse ( totalOPRs, Elements, totalOPR ) {
        total     := sum( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = totalOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1", [Real]tempOPC.Value() );
        totalCell := select( totalOPR, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanColumn() = opc );
        totalCell.Value( [String]total );
      }
    }
  *]
}
_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -11,7 +11,9 @@
    opt := macroPlan.OfflinePlanTable( relnew, SaveDateTime := DateTime::ActualTime() );
    
    // ç”Ÿæˆä¸‹çº¿è®¡åˆ’表
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() /*and u.Name() = "Body in White Line 1"*/ ) {
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime()
               and u.Name() = "eMotor Assy (France)" // æµ‹è¯•时可以过滤
              ) {
      // åˆ›å»ºäº§çº¿è¡Œ
      opt.OfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := "", Type := "0" );
      
_Main/BL/Type_OfflinePlanRow/Method_Filter.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method Filter (
  Entitys entitys
) declarative remote as Boolean
{
  TextBody:
  [*
    flag := false;
    traverse ( entitys, Elements.astype( Unit ), u, not flag ) {
      flag := u.Name() = this.ProductionLine();
    }
    return flag;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_MatrixEditor951.def
@@ -45,6 +45,8 @@
          Properties:
          [
            DataType: 'OfflinePlanTable'
            FilterArguments: 'entities:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderCheckedEntities'
            FixedFilter: 'object.Filter( entities )'
            Source: 'dhOfflinePlanTable'
            Taborder: 0
            Transformation: 'OfflinePlanRow'
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_pHeader.def
@@ -11,7 +11,7 @@
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Refresh'
        Image: 'REFRESH'
        Taborder: 0
      ]
    }
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_pHeader_bDeductionOfReplacementLoss_OnClick.def
@@ -5,8 +5,21 @@
  #keys: '[413988.0.1297973984]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      OfflinePlanCell::DeductionOfReplacementLoss( MacroPlan, dhOfflinePlanTable.Data() );
      opt := maxselect( MacroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() );
      dhOfflinePlanTable.Data( opt );
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
}