Sfoglia il codice sorgente

bug fix

tags/Baseline_30082024_BACKEND_UAT
leoho2fi 1 anno fa
parent
commit
28125b2d45
3 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. +1
    -1
      src/main/java/com/ffii/tsms/modules/project/entity/Project.kt
  2. +2
    -2
      src/main/java/com/ffii/tsms/modules/project/entity/ProjectRepository.kt
  3. +1
    -1
      src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt

+ 1
- 1
src/main/java/com/ffii/tsms/modules/project/entity/Project.kt Vedi File

@@ -118,4 +118,4 @@ open class Project : BaseEntity<Long>() {

@Column(name = "isClpProject")
open var isClpProject: Boolean? = null
}
}

+ 2
- 2
src/main/java/com/ffii/tsms/modules/project/entity/ProjectRepository.kt Vedi File

@@ -18,7 +18,7 @@ interface ProjectRepository : AbstractRepository<Project, Long> {

fun findFirstByIsClpProjectAndIdIsNotOrderByIdDesc(isClpProject: Boolean, id: Serializable?): Project?

fun findAllByPlanStartLessThanEqualAndPlanEndGreaterThanEqual(remainedDateFrom: LocalDate?, remainedDateTo: LocalDate?)
fun findAllByPlanStartLessThanEqualAndPlanEndGreaterThanEqual(remainedDateFrom: LocalDate?, remainedDateTo: LocalDate?):List<Project>

fun findAllByDateRange(start: LocalDate, end: LocalDate): List<Project>
//fun findAllByDateRange(start: LocalDate, end: LocalDate): List<Project>
}

+ 1
- 1
src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt Vedi File

@@ -141,7 +141,7 @@ fun downloadLateStartReport(@RequestBody @Valid request: LateStartReportRequest)
val customer = customerRepository.findByName(request.customer).orElseThrow()
// ?: throw Exception("Customer not found with name: ${request.customer}")
val projects = projectRepository.findAllByDateRange(request.remainedDateFrom, request.remainedDateTo)
val projects = projectRepository.findAllByPlanStartLessThanEqualAndPlanEndGreaterThanEqual(request.remainedDateFrom, request.remainedDateTo)
if (projects.isEmpty()) {
throw Exception("No projects found for the given date: ${request.reportDate}")
}


Caricamento…
Annulla
Salva