xiaoding721
2024-10-21 660578a29abae9e3a4584de89d0642820e592b46
修复一些bug
已添加1个文件
已修改4个文件
73 ■■■■ 文件已修改
_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData#530.qbl 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick#723.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_dhXMLDataListener_OnDataChanged.def 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ExportXMLManager/StaticMethod_AwaitLocalTableXMLData#530.qbl
对比新文件
@@ -0,0 +1,27 @@
Quintiq file version 2.0
#parent: #root
StaticMethod AwaitLocalTableXMLData (
  const Strings columnXMLData,
  RecycleBin owner,
  String tableName,
  String sheetName
)
{
  TextBody:
  [*
    // rislai Jun-21-2024 (created)
    manager := select( owner,ExportXMLManager,manager,manager.Name() = tableName );
    if( not isnull( manager )){
      manager.Delete();
    }
    manager := owner.ExportXMLManager( relnew,Name := tableName,SheetName := sheetName );
    traverse( columnXMLData,Elements,element,element.TrimBoth() <> "" ){
       data := manager.ExportXMLData( relnew, XML := element);
       try{
         data.Priority( data.CalculatePriority( ));
       }onerror{
         info( element );
       }
    }
  *]
}
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_AsyncExport.qbl
@@ -27,6 +27,6 @@
      columnstring := columnstring.Merge( cellxml);
    }
     
    columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,guard( rows.Element(0).LocalTable().Name(),LocalCell_DemandComparison::GetTableName()) );
    columnstring -> GroupAll() -> ExportXMLManager::AwaitLocalTableXMLData( recycleBin,LocalCell_DemandComparison::GetTableName(),guard( rows.Element(0).LocalTable().Name(),"") );
  *]
}
_Main/BL/Type_LocalCell_DemandComparison/StaticMethod_Compared.qbl
@@ -58,7 +58,7 @@
        columns := construct( LocalColumns );
        LocalCell_DemandComparison::GenerateColumnIndex( baseVersionTable,localTable,columnTree,columns );
        LocalCell_DemandComparison::GenerateColumnIndex( compareVersionTable,localTable,columnTree,columns );
        columnNames := selectvalues( columns,Elements,column,true,column.Name() );
        columnNames := selectvalues( columns,Elements,column,true,column.CustomName());
        
        // 鐢熸垚鏁版嵁
        for ( rowIndex := 0; rowIndex < rowKeys.Size(); rowIndex++ ) {
@@ -75,24 +75,30 @@
          
          row := localTable.LocalRow( relnew,Index := localTable.GetRowIndexCache()  );
          
          traverse( columnNames,Elements,columnName ){
          traverse( columnNames,Elements,columnName ,columnName <> "" ){
            columnHandle := columnTree.GetHandle( columnName );
            columnIndex := columnTree.Root().Child( columnHandle ).GetValueAsNumber();
            column := columns.Element( columnIndex );
            columnIndex := guard( columnTree.Root().Child( columnHandle ) , null( NamedValue ));
            column := null( LocalColumn );
            if( not isnull( columnIndex )){
              column := columns.Element( columnIndex.GetValueAsNumber() );
            }
            if( isnull( column )){
              error( columnName + " is null." );
            }
            
            baseVersionCell := constnull( GeneralExcelImportAndExportDataCell );
            baseVersionCellHandle := baseVersionCellTree.GetHandle( columnName );
            try{
              baseVersionCellIndex := baseVersionCellTree.Root().Child( baseVersionCellHandle ).GetValueAsNumber();
              baseVersionCell := baseVersionCells.Element( baseVersionCellIndex );
            }onerror{}
            baseVersionCellIndex := guard( baseVersionCellTree.Root().Child( baseVersionCellHandle ),null( NamedValue ));
            if( not isnull( baseVersionCellIndex )){
              baseVersionCell := baseVersionCells.Element( baseVersionCellIndex.GetValueAsNumber() );
            }
            
            compareVersionCell := constnull( GeneralExcelImportAndExportDataCell );
            compareVersionCellHandle := compareVersionCellTree.GetHandle( columnName );
            try{
              compareVersionCellIndex := compareVersionCellTree.Root().Child( compareVersionCellHandle ).GetValueAsNumber();
              compareVersionCell := compareVersionCells.Element( compareVersionCellIndex );
            }onerror{}
            compareVersionCellIndex := guard( compareVersionCellTree.Root().Child( compareVersionCellHandle ),null( NamedValue ));
            if( not isnull( compareVersionCellIndex )){
              compareVersionCell := compareVersionCells.Element( compareVersionCellIndex.GetValueAsNumber() );
            }
            
            if( columnName = "浜у湴" or columnName = "杞﹀瀷" or columnName = "鍙戝姩鏈洪浂浠跺彿" or columnName = "鍙戝姩鏈哄洓浣嶇爜" ){
              row.LocalCell( relnew,LocalCell_DemandComparison,LocalColumn := column,
@@ -137,7 +143,7 @@
      if( not isnull( compareVersionFile )){
        compareVersionFile.Close(); 
      }
      error( e );
      error( e.GeneralInformation() );
    }
    
    return localTable;
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_bExport_OnClick#723.def
@@ -9,7 +9,7 @@
  {
    Body:
    [*
      rows := selectset( dhComparisonData.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,product,product.ID() = row.Name() ) );
      rows := selectset( dhComparisonData.Data(),LocalRow,row,exists( dhFinelProduct.Data(),Elements,product,product.ID() = row.ProductID()));
      columns := selectset( dhComparisonData.Data( ),LocalColumn,column,not column.IsAttrbuteColumn() and dhStartDate.Data() <= column.Date() and dhEndDate.Data() > column.Date() );
      LocalCell_DemandComparison::AsyncExport( RecycleBin, rows, columns ,MacroPlan );
    *]
_Main/UI/MacroPlannerWebApp/Component_FormDemandComparison/Response_PanelOperation_568_dhXMLDataListener_OnDataChanged.def
@@ -9,11 +9,11 @@
  {
    Body:
    [*
      binaryValue := dhXMLDataListener.Data( ).Export();
      Application.Download( LocalCell_DemandComparison::GetTableName() + "_" + DateTime::Now().Format( "YM2D2H2mmss" ) + ".xlsx", binaryValue.AsBinaryData() );
      dhXMLDataListener.Data( ).Delete();
      if( not isnull( dhXMLDataListener.Data() )){
        binaryValue := dhXMLDataListener.Data( ).Export();
        Application.Download( dhXMLDataListener.Data().SheetName() + "_" + DateTime::Now().Format( "YM2D2H2mmss" ) + ".xlsx", binaryValue.AsBinaryData() );
        dhXMLDataListener.Data( ).Delete();
      }
    *]
    GroupServerCalls: false
  }