admin
2024-10-09 9900634760ba0678301cb9e839036eee1124a4b2
上线计划优化
已修改1个文件
24 ■■■■ 文件已修改
_Main/BL/Type_AssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_AssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
@@ -12,8 +12,11 @@
    
    // 找装配线行
    oprs := selectsortedset( opt, OfflinePlanRow, tempOPR, 
                             tempOPR.ProductionLine() = "DL MoMo"
    //                         or tempOPR.ProductionLine() = "CC MoMo" or tempOPR.ProductionLine() = "DL ZKM"
    //                         tempOPR.ProductionLine() = "DL MoMo"
    //                         or
                             tempOPR.ProductionLine() = "CC MoMo"
    //                         or
    //                         tempOPR.ProductionLine() = "DL ZKM"
                             , 
                             tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() );
@@ -43,17 +46,17 @@
                               );
      
      u           := select( macroPlan, Unit, tempU, tempU.ID() = pl );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject() = "排空", false ) );
      lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject() = "铺线", false ) );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "拉空" ), false ) );
      lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "铺线" ), false ) );
      
      // 处理排空
      info( "当前产线:", pl, "    处理排空--------------------------" );
      info( "当前产线:", pl, "    处理拉空--------------------------" );
      traverse ( drainPs, Elements, p ) {
        traverse ( p, ExplicitTimeInterval, eti ) {
          info( "开始时间:", eti.Start().Format( "Y-M2-D2" ), "    结束时间:", eti.End().Format( "Y-M2-D2" ) );
          // 前一天日历
          aopc := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = ( eti.Start().Date() - 1 ) );
          info( "需要排空的上线计划时间:", aopc.ColumnDate().Format( "Y-M2-D2" ) );
          info( "需要拉空的上线计划时间:", aopc.ColumnDate().Format( "Y-M2-D2" ) );
          aoprs := selectset( macroPlan, AssemblyOnlinePlanRow, tempAOPR, tempAOPR.ProductionLine() = pl and tempAOPR.Type() = "2" and
                              exists( tempAOPR, AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc and tempAOPC.Value() <> "" ) );
          aopr  := maxselect( aoprs, Elements.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc,
@@ -70,6 +73,15 @@
      traverse ( lineLyingPs, Elements, p ) {
        traverse ( p, ExplicitTimeInterval, eti ) {
          info( "开始时间:", eti.Start().Format( "Y-M2-D2" ), "    结束时间:", eti.End().Format( "Y-M2-D2" ) );
          info( "需要铺线的上线计划时间:", eti.Start().Format( "Y-M2-D2" ) );
          aopc  := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = eti.Start().Date() );
          aoprs := selectset( macroPlan, AssemblyOnlinePlanRow, tempAOPR, tempAOPR.ProductionLine() = pl and tempAOPR.Type() = "2" and
                              exists( tempAOPR, AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc and tempAOPC.Value() <> "" ) );
          aopr  := minselect( aoprs, Elements.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc,
                              [Number]tempAOPC.Value().ReplaceAll( "#0", "" ) );
          cell  := select( macroPlan, AssemblyOnlinePlanRow.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanRow().ProductionLine() = pl and tempAOPC.AssemblyOnlinePlanColumn() = aopc and
                           tempAOPC.AssemblyOnlinePlanRow().Type() = "1" and tempAOPC.AssemblyOnlinePlanRow().ProductID() = aopr.AssemblyOnlinePlanRow().ProductID() );
          cell.Value( [String] ( [Number]cell.Value() + targetQuantity ) );
        }
      }
    }