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