Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
cf1a0441
Commit
cf1a0441
authored
Nov 29, 2021
by
jgomez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SchedulerTask
Arreglo en recuperacion de nombre de calendario
parent
5085570f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
SchedulerTaskService.java
...java/com/bytesw/bytebot/service/SchedulerTaskService.java
+5
-12
No files found.
src/main/java/com/bytesw/bytebot/service/SchedulerTaskService.java
View file @
cf1a0441
...
...
@@ -20,9 +20,6 @@ import java.util.*;
@Transactional
public
class
SchedulerTaskService
extends
XDFService
<
SchedulerTask
,
SchedulerTaskBean
,
BigInteger
>
{
@Autowired
private
CalendarService
calendarService
;
@Autowired
private
CalendarService
CalendarService
;
...
...
@@ -45,14 +42,12 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
throw
new
NotFoundException
(
"Calendar can not be null"
);
}
Optional
<
Calendar
>
calendarOptional
=
this
.
calendarRepository
.
findById
(
bean
.
getCalendarID
());
if
(!
calendarOptional
.
isPresent
())
{
throw
new
NotFoundException
(
"Calendar not found "
+
bean
.
getCalendarID
());
}
model
.
setCalendar
(
calendarOptional
.
get
());
return
model
;
}
...
...
@@ -61,13 +56,11 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
SchedulerTaskBean
bean
=
new
SchedulerTaskBean
();
BeanUtils
.
copyProperties
(
model
,
bean
);
bean
.
setInternals
(
model
.
getInternals
().
booleanValue
()
?
"Y"
:
"N"
);
// bean.setCalendar(model.getCalendar().getId());
Optional
<
Calendar
>
found
=
this
.
calendarRepository
.
findById
(
bean
.
getCalendarID
());
// Optional<Calendar> calendarModel = this.calendarRepository.findCalendarById("C-MSG");
if
(
found
.
isPresent
()){
bean
.
setCalendarName
(
found
.
get
().
getName
());
}
else
{
bean
.
setCalendarName
(
"Sigue intenetando"
);
CalendarBean
found
=
this
.
CalendarService
.
getById
(
bean
.
getCalendarID
().
trim
());
if
(
found
!=
null
){
bean
.
setCalendarName
(
found
.
getName
());
}
return
bean
;
...
...
Write
Preview
Markdown
is supported
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