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
8c48bb1f
Commit
8c48bb1f
authored
Dec 17, 2021
by
Roberto Loayza Miljanovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_marcos' into 'developer'
Dev marcos See merge request ByteBot/web/bytebot-service!18
parents
e0102006
0f43298e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
SchedulerTask.java
src/main/java/com/bytesw/bytebot/model/SchedulerTask.java
+4
-4
SchedulerTaskRepository.java
...om/bytesw/bytebot/repository/SchedulerTaskRepository.java
+1
-1
CalendarService.java
...main/java/com/bytesw/bytebot/service/CalendarService.java
+5
-3
No files found.
src/main/java/com/bytesw/bytebot/model/SchedulerTask.java
View file @
8c48bb1f
...
@@ -50,10 +50,10 @@ public class SchedulerTask implements Serializable {
...
@@ -50,10 +50,10 @@ public class SchedulerTask implements Serializable {
@Column
(
name
=
"cale_id"
)
@Column
(
name
=
"cale_id"
)
private
String
calendarID
;
private
String
calendarID
;
@ManyToOne
(
optional
=
false
)
//
@ManyToOne(optional = false)
@NotFound
(
action
=
NotFoundAction
.
IGNORE
)
//
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn
(
name
=
"CALE_ID"
,
referencedColumnName
=
"CALE_ID"
,
nullable
=
false
)
//
@JoinColumn(name = "CALE_ID", referencedColumnName = "CALE_ID", nullable = false)
private
Calendar
calendar
;
//
private Calendar calendar;
/*@ManyToOne(optional = false)
/*@ManyToOne(optional = false)
...
...
src/main/java/com/bytesw/bytebot/repository/SchedulerTaskRepository.java
View file @
8c48bb1f
...
@@ -12,7 +12,7 @@ import java.util.Optional;
...
@@ -12,7 +12,7 @@ import java.util.Optional;
public
interface
SchedulerTaskRepository
extends
CrudRepository
<
SchedulerTask
,
BigInteger
>,
JpaSpecificationExecutor
<
SchedulerTask
>
{
public
interface
SchedulerTaskRepository
extends
CrudRepository
<
SchedulerTask
,
BigInteger
>,
JpaSpecificationExecutor
<
SchedulerTask
>
{
@Query
(
"select b from SchedulerTask b where b.calendar
.id
= :calendarId"
)
@Query
(
"select b from SchedulerTask b where b.calendar
ID
= :calendarId"
)
Optional
<
List
<
SchedulerTask
>>
findByCalendarId
(
@Param
(
"calendarId"
)
String
calendarId
);
Optional
<
List
<
SchedulerTask
>>
findByCalendarId
(
@Param
(
"calendarId"
)
String
calendarId
);
@Query
(
"select b from SchedulerTask b where b.processETL = :processId"
)
@Query
(
"select b from SchedulerTask b where b.processETL = :processId"
)
...
...
src/main/java/com/bytesw/bytebot/service/CalendarService.java
View file @
8c48bb1f
...
@@ -128,11 +128,11 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
...
@@ -128,11 +128,11 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
if
(
weekSchedulerBean
.
getId
()
!=
null
)
{
if
(
weekSchedulerBean
.
getId
()
!=
null
)
{
Optional
<
WeekScheduler
>
weekSchedulerOptional
=
this
.
weekSchedulerRepository
.
findById
(
weekSchedulerBean
.
getId
());
Optional
<
WeekScheduler
>
weekSchedulerOptional
=
this
.
weekSchedulerRepository
.
findById
(
weekSchedulerBean
.
getId
());
if
(
weekSchedulerOptional
.
isPresent
())
{
if
(
weekSchedulerOptional
.
isPresent
())
{
weekIds
.
add
(
weekSchedulerOptional
.
get
().
getId
());
if
(
delete
)
{
if
(
delete
)
{
this
.
weekSchedulerRepository
.
delete
(
weekSchedulerOptional
.
get
());
this
.
weekSchedulerRepository
.
delete
(
weekSchedulerOptional
.
get
());
continue
;
continue
;
}
}
weekIds
.
add
(
weekSchedulerOptional
.
get
().
getId
());
weekScheduler
=
weekSchedulerOptional
.
get
();
weekScheduler
=
weekSchedulerOptional
.
get
();
}
else
{
}
else
{
weekScheduler
=
new
WeekScheduler
();
weekScheduler
=
new
WeekScheduler
();
...
@@ -158,7 +158,7 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
...
@@ -158,7 +158,7 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
if
(
weekSchedulerBeanListBD
.
isPresent
()){
if
(
weekSchedulerBeanListBD
.
isPresent
()){
for
(
WeekScheduler
weekScheduler:
weekSchedulerBeanListBD
.
get
())
{
for
(
WeekScheduler
weekScheduler:
weekSchedulerBeanListBD
.
get
())
{
if
(!
weekIds
.
contains
(
weekScheduler
.
getId
()))
{
if
(!
weekIds
.
contains
(
weekScheduler
.
getId
()))
{
weekSchedulerRepository
.
deleteById
(
weekScheduler
.
getId
());
weekSchedulerRepository
.
deleteById
(
weekScheduler
.
getId
());
}
}
}
}
}
}
...
@@ -174,6 +174,9 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
...
@@ -174,6 +174,9 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
if
(
calendarExceptionBean
.
getId
()
!=
null
)
{
if
(
calendarExceptionBean
.
getId
()
!=
null
)
{
Optional
<
CalendarException
>
calendarExceptionOptional
=
calendarExceptionRepository
.
findById
(
calendarExceptionBean
.
getId
());
Optional
<
CalendarException
>
calendarExceptionOptional
=
calendarExceptionRepository
.
findById
(
calendarExceptionBean
.
getId
());
if
(
calendarExceptionOptional
.
isPresent
())
{
exceptionIds
.
add
(
calendarExceptionBean
.
getId
());
}
if
(
calendarExceptionBean
.
isDelete
())
{
if
(
calendarExceptionBean
.
isDelete
())
{
calendarExceptionRepository
.
delete
(
calendarExceptionOptional
.
get
());
calendarExceptionRepository
.
delete
(
calendarExceptionOptional
.
get
());
continue
;
continue
;
...
@@ -183,7 +186,6 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
...
@@ -183,7 +186,6 @@ public class CalendarService extends XDFService<Calendar, CalendarBean, String>
if
(!
calendarExceptionOptional
.
get
().
getFrequencyType
().
equals
(
calendarExceptionBean
.
getFrequencyType
()))
{
if
(!
calendarExceptionOptional
.
get
().
getFrequencyType
().
equals
(
calendarExceptionBean
.
getFrequencyType
()))
{
calendarExceptionRepository
.
delete
(
calendarExceptionOptional
.
get
());
calendarExceptionRepository
.
delete
(
calendarExceptionOptional
.
get
());
}
else
{
}
else
{
exceptionIds
.
add
(
calendarExceptionBean
.
getId
());
calendarExceptionBean
.
setCalendar
(
bean
);
calendarExceptionBean
.
setCalendar
(
bean
);
calendarException
=
calendarExceptionService
.
toModel
(
calendarExceptionOptional
.
get
(),
calendarExceptionBean
);
calendarException
=
calendarExceptionService
.
toModel
(
calendarExceptionOptional
.
get
(),
calendarExceptionBean
);
calendarExceptionRepository
.
save
(
calendarException
);
calendarExceptionRepository
.
save
(
calendarException
);
...
...
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