xiaoding721
2024-08-29 b2a7528d89d6e01276b2667f6620ee709ac3281b
修复计划汇总报表的一些bug
已修改7个文件
已添加1个文件
107 ■■■■ 文件已修改
_Main/BL/Type_ExportXMLManager/Method_Export.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary#859/StaticMethod_AsyncExport.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary/Attribute_IsFristWeekData.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_CreateFullTable.qbl 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MP_Column/Function_CalcIndex.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pExport_bExport_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormScheduleSummaryReport/Response_PanelRibbon322_88_bExport_OnClick.def 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ExportXMLManager/Method_Export.qbl
@@ -11,7 +11,7 @@
      tableHandle := TableHandle::ImportXML( BinaryValue::Construct( this.FinalXML()));
    }onerror{
      this.Delete();
      error( e );
      error( e.GeneralInformation() );
    }
    tableGroupHandle.Add( tableHandle );
    binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true );
_Main/BL/Type_LocalCell_ScheduleSummary#859/StaticMethod_AsyncExport.qbl
@@ -3,7 +3,8 @@
StaticMethod AsyncExport (
  RecycleBin recycleBin,
  const constcontent LocalRows rows,
  const constcontent LocalColumns columns
  const constcontent LocalColumns columns,
  const Strings attributeNames
)
{
  TextBody:
@@ -11,7 +12,7 @@
    // rislai Jun-20-2024 (created)
    sortColumns := selectsortedset( columns,Elements,column,true,column.Index());
    
    attributeNames := LocalCell_ScheduleSummary::GetAttributeNames();
    // attributeNames := LocalCell_ScheduleSummary::GetAttributeNames();
    
    columnstring := emit( "" );
    flag := true;
_Main/BL/Type_LocalCell_ScheduleSummary/Attribute_IsFristWeekData.qbl
对比新文件
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute IsFristWeekData
{
  #keys: '3[414996.1.43574725][414996.1.43574724][414996.1.43574726]'
  ValueType: Boolean
}
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
@@ -15,7 +15,8 @@
    table := owner.MP_Table( relnew,Name := MP_Cell_ScheduleSummary::GetTableName());
    
    startDate := owner.StartOfPlanning().Date();
    endDate := startDate + 7;
    endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate();
    
    columns := construct( MP_Columns );
    columnIndexTree := NamedValueTree::Create();
@@ -54,7 +55,14 @@
            capacity := workDay * throughput * workHours.Capacity().HoursAsReal()
          }
          
          isFirstWeekData := true;
          if( column.CustomDate() > startDate + 7 ){
            isFirstWeekData := false;
          }
          row.MP_Cell( relnew,MP_Cell_ScheduleSummary,MP_Column := column,
                       IsFristWeekData := isFirstWeekData,
                       ShiftPattern := unitPeriodTime.ShiftPatternName(),
                       WorkingDay := workDay,
                       Capacity := capacity,
@@ -62,7 +70,9 @@
        }
      }
    }
    traverse( table,MP_Column,column,column.MP_Cell( relsize ) = 0 ){
      column.Delete();
    }
    return table;
  *]
}
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_CreateFullTable.qbl
@@ -35,12 +35,33 @@
       localColumns.Add( localColumn );
       localColumnIndexTree.Root().AddChild( localColumnHandle,localColumns.Size() - 1 );
    }
    traverse( tables,Elements.MP_Row,row ){
       localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() );
    
    localRows := construct( LocalRows );
    localRowIndexTree := NamedValueTree::Create();
    localCells := construct( LocalCell_ScheduleSummarys );
    localCellIndexTree := NamedValueTree::Create();
    //shiftPatternCount := NamedValueTree::Create();
    traverse( tables,Elements.MP_Row,row ){
       rowMacroPlan := row.MP_Table().MacroPlan();
       localRow := null( LocalRow );
       {
         localRowHandle := localRowIndexTree.GetHandle( row.Name() );
         localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
         if( isnull( localRowIndex )){
           localRow := localTable.LocalRow( relnew,CustomName := row.Name(),Index := localTable.GetRowIndexCache() );
           localRows.Add( localRow );
           localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
         }else{
           localRow := localRows.Element( localRowIndex.GetValueAsNumber());
         }
       }
       traverse( localColumns,Elements,localColumn ){
          cells := selectset( row,MP_Cell.astype( MP_Cell_ScheduleSummary ),cell,cell.MP_Column().CustomDate() >= localColumn.CustomDate() and cell.MP_Column().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );
          cells := selectset( row,MP_Cell.astype( MP_Cell_ScheduleSummary ),cell,
                              ifexpr( rowMacroPlan = owner , true , cell.IsFristWeekData()) and
                              cell.MP_Column().CustomDate() >= localColumn.CustomDate() and
                              cell.MP_Column().CustomDate() < localColumn.CustomDate().StartOfNextMonth() );
          
          output := 0.0;
          
@@ -61,7 +82,15 @@
          traverse( cells,Elements,cell ){
             workingDay := workingDay + cell.WorkingDay();
             capacity := capacity + cell.Capacity();
    //         shiftPatternHanlde := shiftPatternCount.GetHandle( cell.ShiftPattern() );
    //         shiftPatternCountValue := guard( shiftPatternCount.Root().Child( shiftPatternHanlde ),null( NamedValue ));
    //         if( isnull( shiftPatternCountValue )){
    //           shiftPatternCount.Root().AddChild( shiftPatternHanlde,1 );
    //         }else{
    //           shiftPatternCountValue.SetValue( shiftPatternCountValue.GetValueAsNumber() + 1 );
    //         }
             if( maxShiftPattern <> cell.ShiftPattern() ){
               if( maxShiftPatternCount = 0 ){
                  maxShiftPattern := cell.ShiftPattern();
@@ -73,12 +102,23 @@
                maxShiftPatternCount ++; 
             }
          }
          localCell := null( LocalCell_ScheduleSummary );
          {
            localCellHandle := localCellIndexTree.GetHandle( row.Name() + localColumn.CustomDate().AsQUILL() );
            localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue ));
            if( isnull( localCellIndex )){
              localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn );
              localCells.Add( localCell );
              localCellIndexTree.Root().AddChild( localCellHandle , localCells.Size() - 1 );
            }else{
              localCell := localCells.Element( localCellIndex.GetValueAsNumber() );
            }
          }
          
          localCell := localRow.LocalCell( relnew,LocalCell_ScheduleSummary,LocalColumn := localColumn );
          localCell.ShiftPattern( maxShiftPattern );
          localCell.WorkingDay( workingDay );
          localCell.Capacity( capacity );
          localCell.Output( output );
          localCell.WorkingDay( localCell.WorkingDay() + workingDay );
          localCell.Capacity( localCell.Capacity() + capacity );
          localCell.Output( localCell.Output() + output );
       }
    }
    
_Main/BL/Type_MP_Column/Function_CalcIndex.qbl
@@ -12,9 +12,13 @@
    index := [String]year;
    if( month < 10 ){
      index := index + "0" + [String]month; 
    }else{
      index := index + [String]month;
    }
    if( day < 10 ){
      index := index + "0" + [String]day; 
    }else{
      index := index + [String]day;
    }
    
    
_Main/UI/MacroPlannerWebApp/Component_FormAnnualPlanReport/Response_pExport_bExport_OnClick.def
@@ -11,7 +11,7 @@
    [*
      rows := selectset( dhComparisonData854.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,entity,entity.ID() = row.ProductID()) and exists( dhFinelStockingPoint.Data(),Elements,entity,entity.DisplayName() = row.StockingPointID())); 
      columns := selectset( dhComparisonData854.Data(),LocalColumn,column,dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() );
      LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns );
      LocalCell_Default::AsyncExport( RecycleBin,rows,columns );
      //Application.Download( "浜у嚭瀵煎叆妯℃澘.xlsx",data.AsBinaryData() );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Component_FormScheduleSummaryReport/Response_PanelRibbon322_88_bExport_OnClick.def
@@ -11,7 +11,20 @@
    [*
      rows := selectset( dhComparisonData854.Data(),LocalRow,row,exists( dhFinelEntity.Data(),Elements,entity,entity.DisplayName() = row.Name() ));
      columns := selectset( dhComparisonData854.Data(),LocalColumn,column,dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() );
      LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns );
      attrbutes := construct( Strings );
      if( cbShiftPlan.Checked() ){
        attrbutes.Add( "ShiftPattern" );
      }
      if( cbWorkday.Checked() ){
        attrbutes.Add( "WorkingDay" );
      }
      if( cbCapacity.Checked() ){
        attrbutes.Add( "Capacity" );
      }
      if( cbOutput.Checked() ){
        attrbutes.Add( "Output" );
      }
      LocalCell_ScheduleSummary::AsyncExport( RecycleBin,rows,columns ,attrbutes );
      //Application.Download( "浜у嚭瀵煎叆妯℃澘.xlsx",data.AsBinaryData() );
    *]
    GroupServerCalls: false