|
@@ -198,8 +198,8 @@ export class DatabaseExcelReaderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Only add non-empty rows
|
|
|
|
|
- if (Object.keys(rowData).length > 0) {
|
|
|
|
|
|
|
+ // Only add non-empty, non-header rows
|
|
|
|
|
+ if (Object.keys(rowData).length > 0 && !this.isCintasHeaderRow(section.tableName, rowData)) {
|
|
|
data.push(rowData);
|
|
data.push(rowData);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -234,6 +234,28 @@ export class DatabaseExcelReaderService {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private isCintasHeaderRow(tableName: string, rowData: Record<string, any>): boolean {
|
|
|
|
|
+ if (tableName !== 'cintas_install_calendar') {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const values = Object.values(rowData)
|
|
|
|
|
+ .map((value) => (typeof value === 'string' ? value.trim().toLowerCase() : ''))
|
|
|
|
|
+ .filter(Boolean);
|
|
|
|
|
+
|
|
|
|
|
+ if (values.length === 0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (values.includes('date of install')) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const hasOpportunityHeader = values.includes('opportunity status');
|
|
|
|
|
+ const hasTrrHeader = values.includes('trr');
|
|
|
|
|
+ return hasOpportunityHeader && hasTrrHeader;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private parseCellAddress(cellPosition: string, rowNumber: number): { row: number; col: number } {
|
|
private parseCellAddress(cellPosition: string, rowNumber: number): { row: number; col: number } {
|
|
|
|
|
|
|
|
let match = cellPosition.match(/([A-Z]+)(\d+)/);
|
|
let match = cellPosition.match(/([A-Z]+)(\d+)/);
|