Sfoglia il codice sorgente

update cross team report

tags/Baseline_30082024_BACKEND_UAT
cyril.tsui 1 anno fa
parent
commit
b0e0f56453
2 ha cambiato i file con 39 aggiunte e 3 eliminazioni
  1. +39
    -3
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt
  2. BIN
      src/main/resources/templates/report/Cross Team Charge Report.xlsx

+ 39
- 3
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Vedi File

@@ -2975,10 +2975,11 @@ open class ReportService(
}

// if (timesheets.isNotEmpty()) {
val combinedTeamCodeColNumber = grades.size
val combinedTeamCodeColNumber = grades.size * 2
val sortedGrades = grades.sortedBy { it.id }
val sortedTeams = teams.sortedBy { it.id }

logger.info(timesheets.filter { it.project?.teamLead?.team?.id != it.staff?.team?.id }.size)
val groupedTimesheets = timesheets
.filter { it.project?.teamLead?.team?.id != it.staff?.team?.id }
.groupBy { timesheetEntry ->
@@ -3060,6 +3061,16 @@ open class ReportService(
alignment = HorizontalAlignment.CENTER
}
}

createCell(columnIndex++).apply {
val cellValue = grade.name.trim().substring(0,1) + grade.name.trim().substring(grade.name.length - 1) + " - Cost Adjusted by Salary Point"
setCellValue(cellValue)
val cloneStyle = workbook.createCellStyle()
cloneStyle.cloneStyleFrom(boldFontWithBorderStyle)
cellStyle = cloneStyle.apply {
alignment = HorizontalAlignment.CENTER
}
}
}

createCell(columnIndex++).apply {
@@ -3106,8 +3117,26 @@ open class ReportService(
grade.id
)]?.sumOf { it.getValue("salary") } ?: 0.0

cellStyle = normalFontWithBorderStyle
cellStyle.dataFormat = accountingStyle
val cloneStyle = workbook.createCellStyle()
cloneStyle.cloneStyleFrom(normalFontWithBorderStyle)
cellStyle = cloneStyle.apply {
dataFormat = accountingStyle
}
}

createCell(columnIndex++).apply {
setCellValue(
groupedTimesheets[Triple(
team.id,
chargedTeam.id,
grade.id
)]?.sumOf { it.getValue("manHour") * it.getValue("salary") } ?: 0.0)

val cloneStyle = workbook.createCellStyle()
cloneStyle.cloneStyleFrom(normalFontWithBorderStyle)
cellStyle = cloneStyle.apply {
dataFormat = accountingStyle
}
}
}

@@ -3149,6 +3178,13 @@ open class ReportService(
cellStyle = normalFontWithBorderStyle
cellStyle.dataFormat = accountingStyle
}

createCell(columnIndex++).apply {
val currentCellLetter = CellReference.convertNumToColString(this.columnIndex)
cellFormula = "sum(${currentCellLetter}${startRow}:${currentCellLetter}${endRow})"
cellStyle = normalFontWithBorderStyle
cellStyle.dataFormat = accountingStyle
}
}

createCell(columnIndex++).apply {


BIN
src/main/resources/templates/report/Cross Team Charge Report.xlsx Vedi File


Caricamento…
Annulla
Salva