Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
holmes
Commits
30a1a7f1
Commit
30a1a7f1
authored
Dec 14, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
c838611b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
DbQueryTask.java
src/main/java/cn/qg/holmes/quartz/DbQueryTask.java
+9
-5
No files found.
src/main/java/cn/qg/holmes/quartz/DbQueryTask.java
View file @
30a1a7f1
...
@@ -55,22 +55,26 @@ public class DbQueryTask extends QuartzJobBean {
...
@@ -55,22 +55,26 @@ public class DbQueryTask extends QuartzJobBean {
if
(
dingText
.
contains
(
"{count}"
))
{
if
(
dingText
.
contains
(
"{count}"
))
{
dingText
=
dingText
.
replace
(
"{count}"
,
String
.
valueOf
(
queryList
.
size
()));
dingText
=
dingText
.
replace
(
"{count}"
,
String
.
valueOf
(
queryList
.
size
()));
}
}
Pattern
numPattern
=
Pattern
.
compile
(
"
\\{\\d}
"
);
Pattern
numPattern
=
Pattern
.
compile
(
"
.*\\(\\{\\d+}\\).*
"
);
Matcher
matcher
=
numPattern
.
matcher
(
dingText
);
Matcher
matcher
=
numPattern
.
matcher
(
dingText
);
List
<
String
>
firstLineDataList
=
null
;
List
<
String
>
firstLineDataList
=
null
;
if
(
queryList
.
size
()
>
0
)
{
if
(
queryList
.
size
()
>
0
)
{
firstLineDataList
=
new
ArrayList
(
queryList
.
get
(
0
).
values
());
firstLineDataList
=
new
ArrayList
(
queryList
.
get
(
0
).
values
());
}
}
int
count
=
matcher
.
groupCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
matcher
.
find
())
{
dingText
.
replace
(
matcher
.
group
(
i
+
1
),
firstLineDataList
.
get
(
i
));
int
count
=
matcher
.
groupCount
();
System
.
out
.
println
(
count
);
System
.
out
.
println
(
matcher
.
group
(
0
));
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
dingText
.
replace
(
matcher
.
group
(
i
+
1
),
firstLineDataList
.
get
(
i
));
}
}
}
return
dingText
;
return
dingText
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
dingText
=
"监控定时任务测试,本次共查出{count}条数据,第一行第一列数据是{0}"
;
String
dingText
=
"监控定时任务测试,本次共查出{count}条数据,第一行第一列数据是{0}
啦啦啦, {1}
"
;
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map1
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
map1
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
map2
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
map2
=
new
LinkedHashMap
<>();
...
...
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