sql.append(" and coalesce(tl.teamId, s.teamId) = :teamId ")
}
sql.append(" group by recordMonth, t.staffId, t.projectId, tl.teamId ")
if (args["groupBy"] == "staff") {
sql.append(" group by recordMonth, t.staffId, t.projectId, tl.teamId ")
} else {
sql.append(" group by recordMonth, t.projectId, tl.teamId ")
}
return jdbcDao.queryForList(sql.toString(), args)
}
@@ -3705,6 +3709,7 @@ open class ReportService(
private fun createProjectManhourSummaryReport(
args: Map<String, Any>,
manhourSummary: List<Map<String, Any>>,
manhourSummary2: List<Map<String, Any>>,
templatePath: String )
: Workbook
{
@@ -3746,7 +3751,7 @@ open class ReportService(
}
.sortedBy { it["projectCode"] as String }
val result2 = manhourSummary.groupBy { mapOf("staff" to it["staff"], "projectCode" to it["projectCode"], "projectName" to it["projectName"], "client" to it["client"]) }
val result2 = manhourSummary2.groupBy { mapOf("staff" to it["staff"], "projectCode" to it["projectCode"], "projectName" to it["projectName"], "client" to it["client"]) }
.map { entry ->
val monthlyConsumption = entry.value.associate { it["recordMonth"] to it["consumed"] }