Skip to content

Commit 1f1f0ec

Browse files
authored
forvalterendepunkt for å sende behandlingens tilstand til dvh på nytt. (#1342)
1 parent a08ae44 commit 1f1f0ec

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

src/main/kotlin/no/nav/familie/tilbake/api/forvaltning/ForvaltningController.kt

+15-11
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import io.swagger.v3.oas.annotations.Operation
44
import no.nav.familie.kontrakter.felles.Fagsystem
55
import no.nav.familie.kontrakter.felles.Ressurs
66
import no.nav.familie.kontrakter.felles.tilbakekreving.Ytelsestype
7+
import no.nav.familie.tilbake.datavarehus.saksstatistikk.BehandlingTilstandService
78
import no.nav.familie.tilbake.forvaltning.ForvaltningService
89
import no.nav.familie.tilbake.oppgave.OppgaveTaskService
910
import no.nav.familie.tilbake.sikkerhet.AuditLoggerEvent
1011
import no.nav.familie.tilbake.sikkerhet.Behandlerrolle
1112
import no.nav.familie.tilbake.sikkerhet.HenteParam
1213
import no.nav.familie.tilbake.sikkerhet.Rolletilgangssjekk
1314
import no.nav.security.token.support.core.api.ProtectedWithClaims
14-
import org.springframework.context.i18n.LocaleContextHolder
1515
import org.springframework.http.MediaType
1616
import org.springframework.validation.annotation.Validated
1717
import org.springframework.web.bind.annotation.GetMapping
@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.RestController
2424
import java.math.BigInteger
2525
import java.time.LocalDate
2626
import java.time.LocalDateTime
27-
import java.time.ZonedDateTime
2827
import java.util.UUID
2928

3029
// Denne kontrollen inneholder tjenester som kun brukes av forvaltningsteam via swagger. Frontend bør ikke kalle disse tjenestene.
@@ -36,6 +35,7 @@ import java.util.UUID
3635
class ForvaltningController(
3736
private val forvaltningService: ForvaltningService,
3837
private val oppgaveTaskService: OppgaveTaskService,
38+
private val behandlingTilstandService: BehandlingTilstandService,
3939
) {
4040
@Operation(summary = "Hent korrigert kravgrunnlag")
4141
@PutMapping(
@@ -164,15 +164,6 @@ class ForvaltningController(
164164
return Ressurs.success(forvaltningService.hentForvaltningsinfo(ytelsestype, eksternFagsakId))
165165
}
166166

167-
@Operation(summary = "Hent locale og klokkeslett")
168-
@GetMapping(
169-
path = ["/hentlocale"],
170-
produces = [MediaType.APPLICATION_JSON_VALUE],
171-
)
172-
fun hentlocale(): Ressurs<String> {
173-
return Ressurs.success(LocaleContextHolder.getLocale().toString() + " " + ZonedDateTime.now())
174-
}
175-
176167
@Operation(summary = "Oppretter FinnGammelBehandlingUtenOppgaveTask som logger ut gamle behandlinger uten åpen oppgave")
177168
@PostMapping(
178169
path = ["/hentBehandlingerUtenOppgave/fagsystem/{fagsystem}"],
@@ -212,6 +203,19 @@ class ForvaltningController(
212203
)
213204
}
214205
}
206+
207+
@Operation(summary = "Send siste tilstand for behandling til DVH")
208+
@PostMapping(
209+
path = ["/sendTilstandTilDVH"],
210+
produces = [MediaType.APPLICATION_JSON_VALUE],
211+
)
212+
fun sendSisteTilstandForBehandlingerTilDVH(
213+
@RequestBody behandlingIder: List<UUID>,
214+
) {
215+
behandlingIder.forEach { behandlingID ->
216+
behandlingTilstandService.opprettSendingAvBehandlingenManuellt(behandlingId = behandlingID)
217+
}
218+
}
215219
}
216220

217221
data class Forvaltningsinfo(

src/main/kotlin/no/nav/familie/tilbake/datavarehus/saksstatistikk/BehandlingTilstandService.kt

+7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ class BehandlingTilstandService(
5757
opprettProsessTask(behandlingId, tilstand, hendelsesbeskrivelse)
5858
}
5959

60+
fun opprettSendingAvBehandlingenManuellt(behandlingId: UUID) {
61+
val hendelsesbeskrivelse = "Sender siste tilstand manuellt på behandling $behandlingId"
62+
63+
val tilstand = hentBehandlingensTilstand(behandlingId)
64+
opprettProsessTask(behandlingId, tilstand, hendelsesbeskrivelse)
65+
}
66+
6067
private fun opprettProsessTask(
6168
behandlingId: UUID,
6269
behandlingstilstand: Behandlingstilstand,

0 commit comments

Comments
 (0)