Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
05b9344d
Commit
05b9344d
authored
Apr 29, 2014
by
Matija Obreza
Browse files
Subrequest's body needs to have new PID when updated
parent
b5eb2daa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/RequestServiceImpl.java
View file @
05b9344d
...
...
@@ -247,7 +247,18 @@ public class RequestServiceImpl implements RequestService {
RequestBody
rb
=
mapper
.
readValue
(
materialRequest
.
getBody
(),
RequestBody
.
class
);
rb
.
pid
=
pid
;
materialRequest
.
setBody
(
serialize
(
rb
));
// Need to update all subrequests
for
(
MaterialSubRequest
subrequest
:
materialRequest
.
getSubRequests
())
{
RequestBody
rbs
=
mapper
.
readValue
(
subrequest
.
getBody
(),
RequestBody
.
class
);
rbs
.
pid
=
pid
;
subrequest
.
setBody
(
serialize
(
rb
));
LOG
.
info
(
"Updating subrequest: "
+
subrequest
);
subRequestRepository
.
save
(
subrequest
);
}
return
requestRepository
.
save
(
materialRequest
);
}
catch
(
IOException
e
)
{
// FIXME Some other exception?
throw
new
RuntimeException
(
"Could not handle request JSON"
,
e
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment