lazhen
2024-10-14 7bdd9bb795041a46eb954bd6bffb1d9bef24a8ff
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
已修改11个文件
已添加13个文件
710 ■■■■■ 文件已修改
_Main/BL/Relations/Relation_NewOfflinePlanTable_NewOfflinePlanColumn_NewOfflinePlanColumn_NewOf.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateComprehensiveHoursReport#1.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/Method_FindProductionLineAndType.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_CreateOldOfflinePlanData.qbl 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_Download.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_Import.qbl 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_OldDownload.qbl 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SaveAsDraft.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Function_CalcColor.qbl 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ShiftPlan/Method_CalculateEventType.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/Sys/Repr/Global/LocalCell_Default.qrp 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_MatrixEditor583.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_matrixeditorContextMenu229.def 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_pHeader.def 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_matrixeditorContextMenu229_mShowOrHide_OnClick.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bDownload_OnClick#870.def 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bImport_OnClick#568.def 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bRestore_OnClick#141.def 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bSaveAsDraft_OnClick#870.def 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_matrixeditorContextMenu204.def 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_matrixeditorContextMenu204_mCreateData_OnClick.def 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_NewOfflinePlanTable_NewOfflinePlanColumn_NewOfflinePlanColumn_NewOf.qbl
@@ -3,8 +3,19 @@
Relation NewOfflinePlanTable_NewOfflinePlanColumn_NewOfflinePlanColumn_NewOfflinePlanTable
{
  #keys: '1[413988.0.1603460118]'
  DefaultRelationStrategy
  DeclarativeSequenceRelationStrategy
  {
    #keys: '13[0.0.0][413988.0.1648701086][413988.0.1648701080][413988.0.1648701087][413988.0.1648701081][413988.0.1648701088][413988.0.1648701082][413988.0.1648701089][413988.0.1648701083][413988.0.1648701090][413988.0.1648701084][413988.0.1648701091][413988.0.1648701085]'
    SequenceElementSuffix: 'NOPColumn'
    SequenceSuffix: 'NOPColumn'
    SortAttributes:
    [
      DeclarativeSequenceRelationSortAttribute
      {
        #keys: '1[413988.0.1648701093]'
        Attribute: 'StartDate'
      }
    ]
  }
  RelationSide.LeftSide NewOfflinePlanColumn
  {
_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateComprehensiveHoursReport#1.qbl
@@ -147,21 +147,26 @@
    }
    
    // å¹³æ—¶åŠ ç­å€çŽ‡
    defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "平时加班倍率" );
    defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "平时加班" );
    if( isnull( defaultMultiplier )){
      defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "平时加班倍率",Multiplier := 1 );
      defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "平时加班倍率",Multiplier := 1.5 );
    }
    
    // ä¼‘息日加班倍率
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "休息日加班倍率");
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "周末加班");
    if( isnull( breakDayMultiplier )){
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "休息日加班倍率",Multiplier := 2 );
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "周末加班",Multiplier := 2 );
    }
    // ä¼‘息日加班倍率
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "调休加班");
    if( isnull( breakDayMultiplier )){
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "调休加班",Multiplier := 2 );
    }
    
    // èŠ‚å‡æ—¥åŠ ç­å€çŽ‡
    holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "节假日加班倍率");
    holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "法定节假日加班");
    if( isnull( holidayMultiplier )){
      holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "节假日加班倍率",Multiplier := 3 );
      holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "法定节假日加班",Multiplier := 3 );
    }
    
    traverse( table,LocalRow,row ){
_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateStandardHoursReport.qbl
@@ -152,21 +152,26 @@
    }
    
    // å¹³æ—¶åŠ ç­å€çŽ‡
    defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "平时加班倍率" );
    defaultMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "平时加班" );
    if( isnull( defaultMultiplier )){
      defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "平时加班倍率",Multiplier := 1 );
      defaultMultiplier := macroPlan.OvertimeMultiplier( relnew,Name := "平时加班倍率",Multiplier := 1.5 );
    }
    
    // ä¼‘息日加班倍率
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "休息日加班倍率");
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "周末加班");
    if( isnull( breakDayMultiplier )){
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "休息日加班倍率",Multiplier := 2 );
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "周末加班",Multiplier := 2 );
    }
    // ä¼‘息日加班倍率
    breakDayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "调休加班");
    if( isnull( breakDayMultiplier )){
      breakDayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "调休加班",Multiplier := 2 );
    }
    
    // èŠ‚å‡æ—¥åŠ ç­å€çŽ‡
    holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "节假日加班倍率");
    holidayMultiplier := select( macroPlan,OvertimeMultiplier,object,object.Name() = "法定节假日加班");
    if( isnull( holidayMultiplier )){
      holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "节假日加班倍率",Multiplier := 3 );
      holidayMultiplier := macroPlan.OvertimeMultiplier( relnew, Name := "法定节假日加班",Multiplier := 3 );
    }
    
    traverse( table,LocalRow,row ){
@@ -186,6 +191,8 @@
      jiabanfeiCell.RealValue( EmployeeCost::GetSalary( unit,holidayMultiplier,jiabanCell.RealValue()));
      
      qiangongCell := LocalCell_Default::GetCell(  rowKey + column7.Name(), cellIndexTree, cells, row, column7 );
      qiangongCell.RealValue( qiangongCell.RealValue() - 1 );
      qiangongfeiCell := LocalCell_Default::GetCell(  rowKey + column11.Name(), cellIndexTree, cells, row, column11 );
      qiangongfeiCell.RealValue( EmployeeCost::GetSalary( unit,defaultMultiplier,qiangongCell.RealValue() ));
      
_Main/BL/Type_NewOfflinePlanCell/Method_FindProductionLineAndType.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Method FindProductionLineAndType (
  String productionLine,
  String type
) as Boolean
{
  TextBody: 'return this.NewOfflinePlanRow().ProductionLine() = productionLine and this.NewOfflinePlanRow().Type() = type and this.Quantity() > 0.0;'
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_CreateOldOfflinePlanData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOldOfflinePlanData (
  MacroPlan macroPlan
) as OfflinePlanTable
{
  TextBody:
  [*
    nopt := maxselect( macroPlan, NewOfflinePlanTable, tempNOPT, true, tempNOPT.SaveDateTime() );
    macroPlan.OfflinePlanTable( relflush );
    opt  := macroPlan.OfflinePlanTable( relnew, SaveDateTime := nopt.SaveDateTime() );
    // åˆ›å»ºåˆ—
    firstColumn  := opt.OfflinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 2 );
    secondColumn := opt.OfflinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 1 );
    traverse ( nopt, NewOfflinePlanColumn, nopc ) {
      opt.OfflinePlanColumn( relnew, ColumnDate := nopc.StartDate() );
    }
    pls := selectuniquevalues( nopt, NewOfflinePlanRow, tempNOPR, true, tempNOPR.ProductionLine() );
    traverse ( pls, Elements, pl ) {
      // åˆ›å»ºæ˜Žç»†è¡Œ
      detailNOPRs := selectsortedset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = pl and tempNOPR.Type() = "1", tempNOPR.ProductionLine(), tempNOPR.ProductID() );
      traverse ( detailNOPRs, Elements, nopr ) {
        quantityOPR := opt.OfflinePlanRow( relnew, ProductionLine := nopr.ProductionLine(), ProductID := nopr.ProductID(), Type := "1" );
        orderOPR    := opt.OfflinePlanRow( relnew, ProductionLine := nopr.ProductionLine(), ProductID := nopr.ProductID(), Type := "2" );
        // ç¬¬ä¸€åˆ—
        quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn,  Value := nopr.Name() );
        orderOPR.OfflinePlanCell(    relnew, OfflinePlanColumn := firstColumn,  Value := "" );
        // ç¬¬äºŒåˆ—
        quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "Quantity" );
        orderOPR.OfflinePlanCell(    relnew, OfflinePlanColumn := secondColumn,  Value := "Order" );
        // æ—¶é—´åˆ—
        traverse ( nopr, NewOfflinePlanCell, nopcell ) {
          opc := select( opt, OfflinePlanColumn, tempOPC, tempOPC.ColumnDate() = nopcell.StartDate() );
          quantityOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := [String]nopcell.Quantity() );
          orderOPR.OfflinePlanCell(    relnew, OfflinePlanColumn := opc, Value := nopcell.Order() );
        }
      }
      // åˆ›å»ºåˆè®¡è¡Œ
      totalNOPR            := select( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = pl and tempNOPR.Type() = "2" );
      totalOPR             := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "3" );
      shiftPatternNameOPR  := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "4" );
      shiftPatternStartOPR := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "5" );
      shiftPatternEndOPR   := opt.OfflinePlanRow( relnew, ProductionLine := totalNOPR.ProductionLine(), ProductID := "Z", Type := "6" );
      // ç¬¬ä¸€åˆ—
      totalOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "合计" );
      shiftPatternNameOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" );
      shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" );
      shiftPatternEndOPR.OfflinePlanCell( relnew, OfflinePlanColumn := firstColumn, Value := "" );
       // ç¬¬äºŒåˆ—
      totalOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "总量" );
      shiftPatternNameOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "班次" );
      shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "班次开始时间" );
      shiftPatternEndOPR.OfflinePlanCell( relnew, OfflinePlanColumn := secondColumn, Value := "班次结束时间" );
      // æ—¶é—´åˆ—
      traverse ( totalNOPR, NewOfflinePlanCell, nopcell ) {
        opc := select( opt, OfflinePlanColumn, tempOPC, tempOPC.ColumnDate() = nopcell.StartDate() );
        totalOPR.OfflinePlanCell(             relnew, OfflinePlanColumn := opc, Value := [String]nopcell.TotalQuantity() );
        shiftPatternNameOPR.OfflinePlanCell(  relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternName() );
        shiftPatternStartOPR.OfflinePlanCell( relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternStart() );
        shiftPatternEndOPR.OfflinePlanCell(   relnew, OfflinePlanColumn := opc, Value := nopcell.ShiftPatternEnd() );
      }
    }
    return opt;
  *]
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_Download.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Download (
  MacroPlan macroPlan,
  NewOfflinePlanRows selectedNOPRs
) as BinaryValue
{
  TextBody:
  [*
    opt  := NewOfflinePlanCell::CreateOldOfflinePlanData( macroPlan );
    oprs := selectset( opt, OfflinePlanRow, tempOPR, exists( selectedNOPRs, Elements, tempNOPR, tempNOPR.ProductionLine() = tempOPR.ProductionLine() ) );
    return NewOfflinePlanCell::OldDownload( macroPlan, oprs );
  *]
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_Import.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Import (
  NewOfflinePlanTable nopt,
  GeneralExcelImportAndExportDataTable table
)
{
  TextBody:
  [*
    cnv2 := StringToDate::StandardConverter();
    cnv2.SetCustomConversion();
    cnv2.CustomFormatString( 'yyyy/MM/dd' );
    productionLine   := "";
    productID        := "";
    isUpdateQuantity := false;
    isUpdateOrder    := false;
    traverse ( table, GeneralExcelImportAndExportDataRow, row ) {
      traverse ( table, GeneralExcelImportAndExportDataColumn, column ) {
        // å•元格值
        cell := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDCell, tempGEIAEDCell.GeneralExcelImportAndExportDataColumn() = column );
        // ç¬¬ä¸€åˆ—判断
        if ( cell.Value().Tokenize( "_" ).Size() = 2 and column.ColumnIndex() = 0 ) {
          productionLine := cell.Value().Tokenize( "_" ).Element( 0 );
          productID      := cell.Value().Tokenize( "_" ).Element( 1 );
        }
        // ç¬¬äºŒåˆ—判断
        if ( cell.Value() = "Quantity" and column.ColumnIndex() = 1 ) {
          isUpdateQuantity := true;
          isUpdateOrder    := false;
        } else if ( cell.Value() = "Order" and column.ColumnIndex() = 1 ) {
          isUpdateQuantity := false;
          isUpdateOrder    := true;
        } else if ( cell.Value() <> "Quantity" and cell.Value() <> "Order" and column.ColumnIndex() = 1 ) {
          isUpdateQuantity := false;
          isUpdateOrder    := false;
        }
        // æ—¶é—´åˆ—æ›´æ–°
        if ( isUpdateQuantity and cnv2.CanConvert( column.Name() ) and column.ColumnIndex() > 1 ) {
          noopcell := select( nopt, NewOfflinePlanRow.NewOfflinePlanCell, tempNOPCell,
                              tempNOPCell.NewOfflinePlanRow().ProductionLine() = productionLine and
                              tempNOPCell.NewOfflinePlanRow().ProductID()      = productID      and
                              tempNOPCell.NewOfflinePlanRow().Type()           = "1"            and
                              tempNOPCell.NewOfflinePlanColumn().StartDate()   = cnv2.Convert( column.Name() ) );
          noopcell.Quantity( [Number]cell.Value() );
        } else if ( isUpdateOrder and cnv2.CanConvert( column.Name() ) and column.ColumnIndex() > 1 ) {
          noopcell := select( nopt, NewOfflinePlanRow.NewOfflinePlanCell, tempNOPCell,
                              tempNOPCell.NewOfflinePlanRow().ProductionLine() = productionLine and
                              tempNOPCell.NewOfflinePlanRow().ProductID()      = productID      and
                              tempNOPCell.NewOfflinePlanRow().Type()           = "1"            and
                              tempNOPCell.NewOfflinePlanColumn().StartDate()   = cnv2.Convert( column.Name() ) );
          noopcell.Order( cell.Value() );
        }
      }
    }
  *]
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_OldDownload.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
Quintiq file version 2.0
#parent: #root
StaticMethod OldDownload (
  MacroPlan macroPlan,
  OfflinePlanRows selectedOPRs
) as BinaryValue
{
  TextBody:
  [*
    xmlDOMI      := XMLDOMImplementation::Create();
    xmlDOM       := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>Sheet1</name></table>' );
    tableElement := xmlDOM.GetElementByTagName( "table", 0 );
    opt  := maxselect( macroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() );
    opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() );
    oprs := selectsortedset( selectedOPRs, Elements, tempOPR, true, tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    traverse ( opcs, Elements, opc ) {
      column := xmlDOM.CreateElement( "column" );
      name   := xmlDOM.CreateElement( "name" );
      type   := xmlDOM.CreateElement( "type" );
      name.TextContent( ifexpr( opc.ColumnDate() < macroPlan.StartOfPlanning().Date(), "*", opc.ColumnDate().Format( "Y/M2/D2" ) ) );
      type.TextContent( "String" );
      column.AppendChild( name );
      column.AppendChild( type );
      traverse ( oprs, Elements, opr ) {
        c    := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow() = opr );
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", guard( c.Value(), "" ) );
        column.AppendChild( cell );
      }
      tableElement.AppendChild( column );
    }
    xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM )
    //info( xmlString );
    tableGroupHandle := TableGroupHandle::Create( "Sheet1" );
    tableHandle      := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) );
    tableGroupHandle.Add( tableHandle );
    binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true );
    return binaryData.AsBinaryValue();
  *]
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -10,6 +10,14 @@
    
    nopt := macroPlan.NewOfflinePlanTable( relnew, SaveDateTime := DateTime::ActualTime() );
    
    // è®¡åˆ’开始时间
    planningDate := macroPlan.StartOfPlanning().Date()
    // åˆå§‹åŒ–下线计划列
    traverse ( macroPlan, Period_MP, pmp, pmp.IsPlanning() and not pmp.IsHistorical() ) {
      nopt.NewOfflinePlanColumn( relnew, StartDate := pmp.StartDate(), EndDate := pmp.EndDate() );
    }
    // ç”Ÿæˆä¸‹çº¿è®¡åˆ’表【一条产线在同一天不会产生两次相同产品的周期任务】
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTime() 
    //           and u.Name() = "eMotor Assy (France)" // æµ‹è¯•本地场景时可以过滤
@@ -48,32 +56,10 @@
            detaileNOPCell := detailedNOPR.NewOfflinePlanCell( relnew, 
                                                               Quantity          := ns.Quantity().Round( 0 ), 
                                                               InventoryWeight   := pispippl.InventoryLevelEnd() - pispippl.MinInventoryLevel(),
                                                               ShiftPatternName  := guard( sdt.Name(), "" ),
                                                               ShiftPatternName  := guard( sp.Name(), "" ),
                                                               ShiftPatternStart := guard( sdt.StartDateTime().Format( "H:m" ), "" ),
                                                               ShiftPatternEnd   := guard( sdt.EndDateTIme().Format( "H:m" ), "" ) );
            detaileNOPCell.NewOfflinePlanColumn( relset, nopc );
          }
        }
      }
      // è®¾ç½®ç”Ÿäº§é¡ºåºã€å¯¹ä¸‹çº¿è®¡åˆ’明细生效】
      // ã€ç”Ÿæˆåˆè®¡ä¸‹çº¿è®¡åˆ’】
      totalNOPR   := nopt.NewOfflinePlanRow( relnew, ProductID := "All", ProductionLine := u.ID(), Type := "2" );
      detailNOPRs := selectset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.Type() = "1" );
      traverse ( detailNOPRs, Elements, detailNOPR ) {
        traverse ( detailNOPR, NewOfflinePlanCell, detailNOPCell ) {
          // ç”Ÿäº§ä¸‹çº¿è®¡åˆ’【产线合计】单元格
          totalNOPRCell   := select( totalNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.NewOfflinePlanColumn() = detailNOPCell.NewOfflinePlanColumn() );
          if ( isnull( totalNOPRCell ) ) {
            totalNOPRCell := totalNOPR.NewOfflinePlanCell( relnew );
            totalNOPRCell.NewOfflinePlanColumn( relset, detailNOPCell.NewOfflinePlanColumn() ); // è®¾ç½®åˆ—
            // å°†æ˜Žç»†å•元格关联到合计单元格
            totalNOPRCell.Detailed( relinsert, detailNOPCell );
          } else {
            // å°†æ˜Žç»†å•元格关联到合计单元格
            totalNOPRCell.Detailed( relinsert, detailNOPCell );
          }
        }
      }
@@ -88,6 +74,87 @@
          }
        }
      }
      // ã€ç”Ÿæˆåˆè®¡ä¸‹çº¿è®¡åˆ’】
      totalNOPR   := nopt.NewOfflinePlanRow( relnew, ProductID := "All", ProductionLine := u.ID(), Type := "2" );
      detailNOPRs := selectset( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.Type() = "1" );
      traverse ( detailNOPRs, Elements, detailNOPR ) {
        shiftPatternNOPCell := select( detailNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.ShiftPatternName() <> "" );
        traverse ( detailNOPR, NewOfflinePlanCell, detailNOPCell ) {
          // ç”Ÿäº§ä¸‹çº¿è®¡åˆ’【产线合计】单元格
          totalNOPRCell   := select( totalNOPR, NewOfflinePlanCell, tempNOPCell, tempNOPCell.NewOfflinePlanColumn() = detailNOPCell.NewOfflinePlanColumn() );
          if ( isnull( totalNOPRCell ) ) {
            totalNOPRCell := totalNOPR.NewOfflinePlanCell( relnew,
                                                           ShiftPatternName  := shiftPatternNOPCell.ShiftPatternName(),
                                                           ShiftPatternStart := shiftPatternNOPCell.ShiftPatternStart(),
                                                           ShiftPatternEnd   := shiftPatternNOPCell.ShiftPatternEnd() );
            totalNOPRCell.NewOfflinePlanColumn( relset, detailNOPCell.NewOfflinePlanColumn() ); // è®¾ç½®åˆ—
            // å°†æ˜Žç»†å•元格关联到合计单元格
            totalNOPRCell.Detailed( relinsert, detailNOPCell );
          } else {
            // å°†æ˜Žç»†å•元格关联到合计单元格
            totalNOPRCell.Detailed( relinsert, detailNOPCell );
          }
        }
      }
      // è®¾ç½®ç”Ÿäº§é¡ºåºã€å¯¹ä¸‹çº¿è®¡åˆ’明细生效】
      indexColumn    := select( nopt, NewOfflinePlanColumn, tempNOPC, tempNOPC.StartDate() = planningDate );
      previousColumn := indexColumn.PreviousNOPColumn();
      nextColumn     := indexColumn.NextNOPColumn();
      while ( not isnull( indexColumn.NextNOPColumn() )
    //          and indexColumn.ColumnDate() <= Date::Construct( 2020, 4, 1 ) // æµ‹è¯•实际场景时可以过滤
             )
      {
        orderNr     := 1;
        nopcells    := selectsortedset( indexColumn, NewOfflinePlanCell, tempNOPCell, tempNOPCell.FindProductionLineAndType( u.ID(), "1" ), tempNOPCell.InventoryWeight() );
        initialSize := nopcells.Size();
    //    info( "计划开始时间:", planningDate.Format( "Y-M2-D2" ), "    ç´¢å¼•时间:", indexColumn.StartDate().Format( "Y-M2-D2" ), "    ä¸ªæ•°ï¼š", nopcells.Size() );
        if ( nopcells.Size() > 0 ) {
          // åˆ¤å®š1
          previousOPCell := maxselect( previousColumn, NewOfflinePlanCell, tempNOPCell, tempNOPCell.FindProductionLineAndType( u.ID(), "1" ), tempNOPCell.OrderNr() );
          if ( isnull( previousOPCell ) or indexColumn.StartDate() = planningDate ) {
            nopcell := nopcells.Element( 0 );
            nopcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) );
            nopcell.OrderNr( orderNr );
            orderNr++;
            nopcells.Remove( nopcell );
          } else {
            nopcell := select( nopcells, Elements, tempNOPCell, tempNOPCell.NewOfflinePlanRow().ProductID() =  previousOPCell.NewOfflinePlanRow().ProductID() );
            if ( not isnull( nopcell ) ) {
              nopcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) );
              nopcell.OrderNr( orderNr );
              orderNr++;
              nopcells.Remove( nopcell );
            }
          }
          // åˆ¤å®š2
          nextNOPCells := selectset( nopcells, Elements, tempOPC,
                                     exists( nextColumn, NewOfflinePlanCell, nextOPCell, nextOPCell.FindProductionLineAndType( u.ID(), "1" ) and
                                             nextOPCell.NewOfflinePlanRow().ProductID() = tempOPC.NewOfflinePlanRow().ProductID() ) ); // æ‰¾ä¸‹ä¸€åˆ—是否有当前列生产的产品
          if ( nextNOPCells.Size() = 1 ) {
            nopcell := nextNOPCells.Element( 0 );
            nopcell.Order( "#" + initialSize.Format( "N(LPad0(2))" ) );
            nopcell.OrderNr( initialSize );
            nopcells.Remove( nopcell );
          }
          // åˆ¤å®š3
          traverse ( nopcells, Elements, opcell ) {
            opcell.Order( "#" + orderNr.Format( "N(LPad0(2))" ) );
            opcell.OrderNr( orderNr );
            orderNr++;
            nopcells.Remove( opcell );
          }
        }
        indexColumn    := indexColumn.NextNOPColumn();
        previousColumn := indexColumn.PreviousNOPColumn();
        nextColumn     := indexColumn.NextNOPColumn();
      }
    }
  *]
}
_Main/BL/Type_NewOfflinePlanCell/StaticMethod_SaveAsDraft.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SaveAsDraft (
  MacroPlan macroPlan,
  NewOfflinePlanTable nopt
) as NewOfflinePlanTable
{
  TextBody:
  [*
    newTable := nopt.DeepCopy().astype( NewOfflinePlanTable );
    newNOPT  := macroPlan.NewOfflinePlanTable( relinsert, &newTable );
    newNOPT.SaveDateTime( DateTime::ActualTime() );
    return newNOPT;
  *]
}
_Main/BL/Type_ShiftPlan/Function_CalcColor.qbl
@@ -14,6 +14,9 @@
    if( this.EventType() = "周日"){
      value := "LightBlue";
    }
    if( this.EventType() = "周末"){
      value := "LightBlue";
    }
    if( this.EventType() = "法定节假日"){
      value := "Red";
    }
_Main/BL/Type_ShiftPlan/Method_CalculateEventType.qbl
@@ -23,14 +23,16 @@
    result := "";
    flag := true;
    traverse( values,Elements,value ,flag){
      if( value = "调休" and result <> "调休"){
      if( value = "调休" and result <> "法定节假日"){
        result := "调休"; 
      }else if( value = "法定节假日" and result <> "法定节假日"){
        result := "法定节假日";
      }else if( value = "周六" and result <> "周六"){
      }else if( value = "周六" and result <> "法定节假日"){
        result := "周六";
      }else if( value = "周日" and result <> "周日"){
      }else if( value = "周日" and result <> "法定节假日"){
        result := "周日";
      }else if( value = "周末" and result <> "法定节假日"){
        result := "周末";
      }
    }
    
_Main/Sys/Repr/Global/LocalCell_Default.qrp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#parent: #root
TypeRepresentation LocalCell_Default
{
  AttributeRepresentation RealValue
  {
    AttributeKey: '[412672.1.5620866]'
    Conditional:
    [
    ]
    DataRepresentation.Default
    {
      FormatString: 'N(Dec(1))'
      InheritFormatting: false
    }
  }
  RelationRepresentation LocalColumn { RelationKey: '[412672.0.1084249679]' Visibility: 'Normal' }
}
_Main/Sys/Repr/Global/NewOfflinePlanCell.qrp
@@ -2,18 +2,40 @@
#parent: #root
TypeRepresentation NewOfflinePlanCell
{
  AttributeRepresentation Order
  {
    Alignment: 'Right'
    AttributeKey: '[413988.0.1603460356]'
  }
  AttributeRepresentation Quantity
  {
    AttributeKey: '[413988.0.1603460346]'
    Conditional:
    [
      DataRepresentation.Conditional
      {
        BackgroundColor: '$FF3399'
        ConversionBody: ''
        DefaultBackgroundColor: false
        InheritConversion: false
      }
    ]
  }
  AttributeRepresentation ShiftPatternEnd
  {
    Alignment: 'Right'
    AttributeKey: '[413988.0.1603460414]'
    Synonym: '班次结束时间'
  }
  AttributeRepresentation ShiftPatternName
  {
    Alignment: 'Right'
    AttributeKey: '[413988.0.1603460388]'
    Synonym: '班次'
  }
  AttributeRepresentation ShiftPatternStart
  {
    Alignment: 'Right'
    AttributeKey: '[413988.0.1603460401]'
    Synonym: '班次开始时间'
  }
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_MatrixEditor583.def
@@ -92,6 +92,7 @@
    AllowMultipleAttributes: true
    Columns: 'MatrixEditorColumns473'
    ContextMenu: 'matrixeditorContextMenu267'
    Editable: false
    Rows: 'MatrixEditorRows569'
    Taborder: 0
  ]
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_matrixeditorContextMenu229.def
@@ -3,6 +3,30 @@
{
  #keys: '[413988.0.1607432887]'
  BaseType: 'matrixeditorContextMenu'
  Children:
  [
    Component mSeparator
    {
      #keys: '[413988.0.1651491148]'
      BaseType: 'WebMenu'
      Properties:
      [
        Separator: true
        Taborder: 2
      ]
    }
    Component mShowOrHide
    {
      #keys: '[413988.0.1651491174]'
      BaseType: 'WebMenu'
      Properties:
      [
        Image: 'POWER'
        Taborder: 3
        Title: 'Show/Hide total'
      ]
    }
  ]
  Properties:
  [
    Taborder: 4
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Component_pHeader.def
@@ -15,6 +15,66 @@
        Taborder: 0
      ]
    }
    Component bDownload id:bDownload_141
    {
      #keys: '[413988.0.1652609611]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Download'
        Taborder: 1
      ]
    }
    Component bImport id:bImport_217
    {
      #keys: '[413988.0.1654241348]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Import'
        Taborder: 2
      ]
    }
    Component bDeductChangeoverLoss id:bDeductChangeoverLoss_737
    {
      #keys: '[413988.0.1652941817]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Deduct changeover loss'
        Taborder: 3
      ]
    }
    Component bRestore id:bRestore_778
    {
      #keys: '[413988.0.1654260514]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Restore'
        Taborder: 4
      ]
    }
    Component bSaveAsDraft id:bSaveAsDraft_870
    {
      #keys: '[413988.0.1654260654]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Save as draft'
        Taborder: 5
      ]
    }
    Component bConfirm id:bConfirm_978
    {
      #keys: '[413988.0.1654260807]'
      BaseType: 'WebButton'
      Properties:
      [
        Label: 'Confirm'
        Taborder: 6
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_matrixeditorContextMenu229_mShowOrHide_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: matrixeditorContextMenu229/mShowOrHide
Response OnClick () id:Response_matrixeditorContextMenu229_mShowOrHide_OnClick
{
  #keys: '[413988.0.1651491239]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  QuillAction
  {
    Body:
    [*
      pTotal.Visible( not pTotal.Visible() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bDownload_OnClick#870.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
Quintiq file version 2.0
#parent: pHeader/bDownload_141
Response OnClick () id:Response_pHeader1_799_bDownload_OnClick_870
{
  #keys: '[413988.0.1652609610]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      binaryValue := NewOfflinePlanCell::Download( MacroPlan, dhSelectedDetailNewOfflinePlanRow.Data() );
      Application.Download( "Output plan.xlsx", binaryValue.AsBinaryData() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bImport_OnClick#568.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
Quintiq file version 2.0
#parent: pHeader/bImport_217
Response OnClick () id:Response_pHeader1_799_bImport_OnClick_568
{
  #keys: '[413988.0.1654241347]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      try {
        uploadJsonString := Application.GetFile();
        if ( uploadJsonString <> "" ) {
          uploadJson := JSON::Parse( uploadJsonString );
          Archive::VerifyTheFileName( uploadJson );
          fileName := uploadJson.Get( "name" ).GetString();
          base64String := uploadJson.Get( "data" ).GetString();
          webFileBinaryData := BinaryData::FromBase64EncodedString( base64String ).AsBinaryValue();
          generalExcelImportAndExportDataSource := GeneralExcelImportAndExportDataSource::Upload( RecycleBin, webFileBinaryData, fileName );
          generalExcelImportAndExportDataSource.ReadStructure();
          selection := select( generalExcelImportAndExportDataSource, GeneralExcelImportAndExportDataTable, tempGEIAEDT, tempGEIAEDT.Name() = "Sheet1" );
          NewOfflinePlanCell::Import( dhNewOfflinePlanTable.Data(), selection );
          // åŽç»­åˆ é™¤
          generalExcelImportAndExportDataSource.Delete();
          WebMessageBox::Success( Translations::A_VWED_Success() );
        }
      } onerror {
        WebMessageBox::Error( e.GeneralInformation() );
      }
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bRestore_OnClick#141.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
Quintiq file version 2.0
#parent: pHeader/bRestore_778
Response OnClick () id:Response_pHeader1_799_bRestore_OnClick_141
{
  #keys: '[413988.0.1654260513]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      currentNOPT := dhNewOfflinePlanTable.Data();
      targetNOPT  := maxselect( MacroPlan, NewOfflinePlanTable, tempNOPT, tempNOPT <> currentNOPT, tempNOPT.SaveDateTime() );
      if ( not isnull( targetNOPT ) ) {
        currentNOPT.Delete();
        dhNewOfflinePlanTable.Data( targetNOPT );
      }
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormNewOfflinePlan/Response_pHeader_bSaveAsDraft_OnClick#870.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: pHeader/bSaveAsDraft_870
Response OnClick () id:Response_pHeader1_799_bSaveAsDraft_OnClick_870
{
  #keys: '[413988.0.1654260653]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      nopt := NewOfflinePlanCell::SaveAsDraft( MacroPlan, dhNewOfflinePlanTable.Data() );
      dhNewOfflinePlanTable.Data( nopt );
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Component_matrixeditorContextMenu204.def
@@ -3,6 +3,30 @@
{
  #keys: '[413988.0.1296803057]'
  BaseType: 'matrixeditorContextMenu'
  Children:
  [
    Component mCreateData
    {
      #keys: '[413988.0.1652900385]'
      BaseType: 'WebMenu'
      Properties:
      [
        Image: 'DATA'
        Taborder: 3
        Title: '最新创建数据方法'
      ]
    }
    Component mSparator
    {
      #keys: '[413988.0.1652900411]'
      BaseType: 'WebMenu'
      Properties:
      [
        Separator: true
        Taborder: 2
      ]
    }
  ]
  Properties:
  [
    Taborder: 4
_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlan/Response_matrixeditorContextMenu204_mCreateData_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
Quintiq file version 2.0
#parent: matrixeditorContextMenu204/mCreateData
Response OnClick () id:Response_matrixeditorContextMenu204_mCreateData_OnClick
{
  #keys: '[413988.0.1652970833]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      NewOfflinePlanCell::CreateOldOfflinePlanData( MacroPlan );
      opt := maxselect( MacroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() );
      dhOfflinePlanTable.Data( opt );
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
}