|
|
@@ -56,7 +56,8 @@ class ReportController( |
|
|
|
private val leaveRepository: LeaveRepository, |
|
|
|
private val teamService: TeamService, |
|
|
|
private val customerService: CustomerService, |
|
|
|
private val invoiceService: InvoiceService, private val gradeAllocationRepository: GradeAllocationRepository |
|
|
|
private val invoiceService: InvoiceService, private val gradeAllocationRepository: GradeAllocationRepository, |
|
|
|
private val subsidiaryRepository: SubsidiaryRepository |
|
|
|
) { |
|
|
|
|
|
|
|
@PostMapping("/fetchProjectsFinancialStatusReport") |
|
|
@@ -94,8 +95,15 @@ class ReportController( |
|
|
|
|
|
|
|
val team = if (request.teamId.lowercase() == "all") null else teamRepository.findById(request.teamId.toLong()).orElse(null) |
|
|
|
val searchedTeam = if (team == null) "All" else team.code + " - " +team.name |
|
|
|
val client = if (request.clientId.lowercase() == "all") null else customerRepository.findById(request.clientId.toLong()).orElse(null) |
|
|
|
val searchedClient = if (client == null) "All" else client.code + " - " +client.name |
|
|
|
val client = if (request.clientId.lowercase() == "all" || request.type != "client") null else customerRepository.findById(request.clientId.toLong()).orElse(null) |
|
|
|
val subsidiary = if (request.clientId.lowercase() == "all" || request.type != "subsidiary") null else subsidiaryRepository.findById(request.clientId.toLong()).orElse(null) |
|
|
|
val searchedClient = if (client != null) { |
|
|
|
client.code + " - " + client.name |
|
|
|
} else if (subsidiary != null) { |
|
|
|
subsidiary.code + " - " + subsidiary.name |
|
|
|
} else { |
|
|
|
"All" |
|
|
|
} |
|
|
|
|
|
|
|
val matcher = ExampleMatcher.matching().withIgnoreNullValues() |
|
|
|
val exampleQuery = Example.of(Project().apply { |
|
|
@@ -103,6 +111,7 @@ class ReportController( |
|
|
|
// [{ com.ffii.tsms.modules.project.entity.Project@6847e037 }] -teamLead-> [{ com.ffii.tsms.modules.data.entity.Staff@2a4c488b }] -team-> [{ com.ffii.tsms.modules.data.entity.Team@a09acb5 }] -staff-> [{ com.ffii.tsms.modules.data.entity.Staff@2a4c488b }] |
|
|
|
// teamLead = team?.staff |
|
|
|
customer = client |
|
|
|
customerSubsidiary = subsidiary |
|
|
|
status = "On-going" |
|
|
|
}, matcher) |
|
|
|
|
|
|
|