Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
889c002c
Commit
889c002c
authored
Nov 30, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新索引--涉及任务下发、定时器修改、任务执行
parent
bd4b5234
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
RepositoryTs.java
...oin/amos/patrol/business/dao/repository/RepositoryTs.java
+1
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+1
-1
RepositoryTImpl.java
...in/amos/patrol/business/service/impl/RepositoryTImpl.java
+20
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/RepositoryTs.java
View file @
889c002c
...
@@ -9,6 +9,7 @@ public interface RepositoryTs {
...
@@ -9,6 +9,7 @@ public interface RepositoryTs {
// 批量更新的方法
// 批量更新的方法
<
S
>
Iterable
<
S
>
batchUpdate
(
Iterable
<
S
>
var1
);
<
S
>
Iterable
<
S
>
batchUpdate
(
Iterable
<
S
>
var1
);
<
S
>
Iterable
<
S
>
batchSaveNoAsync
(
Iterable
<
S
>
var1
);
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
889c002c
...
@@ -966,7 +966,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -966,7 +966,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log
.
error
(
"计划重做开始添加定时任务监控========"
);
log
.
error
(
"计划重做开始添加定时任务监控========"
);
jobService
.
planTaskAddJob
(
planTask
);
jobService
.
planTaskAddJob
(
planTask
);
Iterable
<
PlanTaskDetail
>
planTaskDetails
=
repositoryTs
.
batchSave
(
planTaskDetailListSync
);
Iterable
<
PlanTaskDetail
>
planTaskDetails
=
repositoryTs
.
batchSave
NoAsync
(
planTaskDetailListSync
);
// 3.如果为自动任务调用,则更新id,如果重做或且下次时间大于等于明天,则更新planTaskId到plan表
// 3.如果为自动任务调用,则更新id,如果重做或且下次时间大于等于明天,则更新planTaskId到plan表
Date
genDate
=
DateUtil
.
str2Date
(
list
.
get
(
list
.
size
()
-
1
).
get
(
"NEXT_GEN_DATE"
).
toString
(),
"yyyy-MM-dd"
);
//下次生成日期
Date
genDate
=
DateUtil
.
str2Date
(
list
.
get
(
list
.
size
()
-
1
).
get
(
"NEXT_GEN_DATE"
).
toString
(),
"yyyy-MM-dd"
);
//下次生成日期
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RepositoryTImpl.java
View file @
889c002c
...
@@ -23,7 +23,7 @@ public class RepositoryTImpl implements RepositoryTs {
...
@@ -23,7 +23,7 @@ public class RepositoryTImpl implements RepositoryTs {
@Override
@Override
@Transactional
@Transactional
//
@Async("asyncServiceExecutor")
@Async
(
"asyncServiceExecutor"
)
public
<
S
>
Iterable
<
S
>
batchSave
(
Iterable
<
S
>
var1
)
{
public
<
S
>
Iterable
<
S
>
batchSave
(
Iterable
<
S
>
var1
)
{
Iterator
<
S
>
iterator
=
var1
.
iterator
();
Iterator
<
S
>
iterator
=
var1
.
iterator
();
int
index
=
0
;
int
index
=
0
;
...
@@ -60,4 +60,23 @@ public class RepositoryTImpl implements RepositoryTs {
...
@@ -60,4 +60,23 @@ public class RepositoryTImpl implements RepositoryTs {
}
}
return
var1
;
return
var1
;
}
}
@Override
public
<
S
>
Iterable
<
S
>
batchSaveNoAsync
(
Iterable
<
S
>
var1
)
{
Iterator
<
S
>
iterator
=
var1
.
iterator
();
int
index
=
0
;
while
(
iterator
.
hasNext
()){
em
.
persist
(
iterator
.
next
());
index
++;
if
(
index
%
BATCH_SIZE
==
0
){
em
.
flush
();
em
.
clear
();
}
}
if
(
index
%
BATCH_SIZE
!=
0
){
em
.
flush
();
em
.
clear
();
}
return
var1
;
}
}
}
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