|
|
|
@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.RequestParam |
|
|
|
import org.springframework.web.bind.annotation.RestController |
|
|
|
import java.time.LocalDate |
|
|
|
import java.time.LocalDateTime |
|
|
|
import java.time.LocalTime |
|
|
|
|
|
|
|
/** |
|
|
|
* Public API for Python clients. No login required. |
|
|
|
@@ -34,8 +33,8 @@ open class PyController( |
|
|
|
): ResponseEntity<List<PyJobOrderListItem>> { |
|
|
|
val date = planStart ?: LocalDate.now() |
|
|
|
val dayStart = date.atStartOfDay() |
|
|
|
val dayEnd = date.atTime(LocalTime.MAX) |
|
|
|
val orders = jobOrderRepository.findByDeletedFalseAndPlanStartBetweenOrderByIdAsc(dayStart, dayEnd) |
|
|
|
val dayEndExclusive = date.plusDays(1).atStartOfDay() |
|
|
|
val orders = jobOrderRepository.findByDeletedFalseAndPlanStartFromBeforeExclusiveOrderByIdAsc(dayStart, dayEndExclusive) |
|
|
|
val list = orders.map { jo -> toListItem(jo) } |
|
|
|
return ResponseEntity.ok(list) |
|
|
|
} |
|
|
|
|