Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
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
head_group
xyqb-user2
Commits
fa95cd9b
Commit
fa95cd9b
authored
Jul 20, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加异常控制
parent
5c4b10c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
CleanDataServiceImp.java
...uantgroup/xyqb/service/user/impl/CleanDataServiceImp.java
+24
-21
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/CleanDataServiceImp.java
View file @
fa95cd9b
...
@@ -75,11 +75,15 @@ public class CleanDataServiceImp implements CleanDataService {
...
@@ -75,11 +75,15 @@ public class CleanDataServiceImp implements CleanDataService {
calendar
.
setTime
(
parse
);
calendar
.
setTime
(
parse
);
long
all
=
0L
;
long
all
=
0L
;
while
(
true
)
{
while
(
true
)
{
Timestamp
start
=
new
Timestamp
(
calendar
.
getTime
().
getTime
());
Timestamp
start
=
new
Timestamp
(
calendar
.
getTime
().
getTime
());
calendar
.
add
(
Calendar
.
MONTH
,
1
);
calendar
.
add
(
Calendar
.
MONTH
,
1
);
Timestamp
end
=
new
Timestamp
(
calendar
.
getTime
().
getTime
());
Timestamp
end
=
new
Timestamp
(
calendar
.
getTime
().
getTime
());
String
starDate
=
(
start
.
getYear
()
+
1900
)
+
"年"
+
(
start
.
getMonth
()
+
1
)
+
"月"
+
start
.
getDate
()
+
"日"
;
String
endDate
=
(
end
.
getYear
()
+
1900
)
+
"年"
+
(
end
.
getMonth
()
+
1
)
+
"月"
+
end
.
getDate
()
+
"日"
;
try
{
List
<
UserExtInfo
>
list
=
iUserExtInfoService
.
findByCreatedAtAfterAndCreatedAtBeforeAndOccupationEnum
(
start
,
end
);
List
<
UserExtInfo
>
list
=
iUserExtInfoService
.
findByCreatedAtAfterAndCreatedAtBeforeAndOccupationEnum
(
start
,
end
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
...
@@ -93,21 +97,20 @@ public class CleanDataServiceImp implements CleanDataService {
...
@@ -93,21 +97,20 @@ public class CleanDataServiceImp implements CleanDataService {
}
}
}
}
}
}
String
starDate
=
(
start
.
getYear
()
+
1900
)
+
"年"
+
(
start
.
getMonth
()
+
1
)
+
"月"
+
start
.
getDate
()
+
"日"
;
String
endDate
=
(
end
.
getYear
()
+
1900
)
+
"年"
+
(
end
.
getMonth
()
+
1
)
+
"月"
+
end
.
getDate
()
+
"日"
;
log
.
info
(
"开始时间start:{},结束时间end: {} ,条数:{}"
,
starDate
,
endDate
,
list
.
size
());
log
.
info
(
"开始时间start:{},结束时间end: {} ,条数:{}"
,
starDate
,
endDate
,
list
.
size
());
re
.
put
(
starDate
+
"-"
+
endDate
,
list
.
size
());
re
.
put
(
starDate
+
"-"
+
endDate
,
list
.
size
());
if
(
end
.
after
(
new
Date
()))
{
if
(
end
.
after
(
new
Date
()))
{
break
;
break
;
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"时间段:{}--{}执行异常,e"
,
starDate
,
endDate
,
e
);
}
}
log
.
info
(
"清洗结束总共清洗了all:{}条,耗时:{}秒"
,
all
,
s
.
elapsed
(
TimeUnit
.
SECONDS
));
log
.
info
(
"清洗结束总共清洗了all:{}条,耗时:{}秒"
,
all
,
s
.
elapsed
(
TimeUnit
.
SECONDS
));
}
log
.
info
(
"清洗明细:{} "
,
re
);
log
.
info
(
"清洗明细:{} "
,
re
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"清洗的时候出现了异常e:{}"
,
e
);
}
finally
{
}
finally
{
stringRedisTemplate
.
delete
(
LOCKKEY
);
stringRedisTemplate
.
delete
(
LOCKKEY
);
}
}
...
...
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