Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SolrDataComparison
Overview
Overview
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
常超
SolrDataComparison
Commits
017301d2
Commit
017301d2
authored
Apr 15, 2019
by
chentian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
38fc17f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
src/main/java/com/cc/solr/job/TrackDataJob.java
+18
-8
No files found.
src/main/java/com/cc/solr/job/TrackDataJob.java
View file @
017301d2
...
...
@@ -54,8 +54,9 @@ public class TrackDataJob implements BaseJob {
System
.
out
.
println
(
"TrackData Job执行时间: "
+
new
Date
());
//查询track表增量,track表djsj>当前任务执行时间-1小时的数据,减一小时是为了避免丢失数据。
System
.
out
.
println
(
"lallalalalalalalalImportdate:"
+
importdate
);
List
<
Track
>
trackList
=
trackService
.
selectTrackList
(
importdate
);
System
.
out
.
println
(
"增量总数:"
+
trackList
.
size
());
System
.
out
.
println
(
"
1:
增量总数:"
+
trackList
.
size
());
Properties
properties
=
propertiesUtil
.
propertiesUtil
(
"solr.properties"
);
String
url
=
properties
.
getProperty
(
"sourcesolrdata"
);
HttpSolrClient
client
=
new
HttpSolrClient
(
url
);
...
...
@@ -68,16 +69,23 @@ public class TrackDataJob implements BaseJob {
params
.
set
(
"q"
,
"ID:"
+
trackList
.
get
(
i
).
getId
());
//执行搜索
QueryResponse
queryResponse
=
null
;
int
solrflag
=
0
;
int
solrSize
=
0
;
try
{
queryResponse
=
client
.
query
(
core
,
params
);
}
catch
(
SolrServerException
e
)
{
}
catch
(
Exception
e
){
solrflag
=
1
;
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
finally
{
//搜索结果
//System.out.println("2:solrflag:"+solrflag);
if
(
solrflag
==
0
){
SolrDocumentList
resultsize
=
queryResponse
.
getResults
();
if
(
resultsize
.
size
()==
0
){
//0表示数据源里没有
solrSize
=
resultsize
.
size
();
}
else
if
(
solrflag
==
1
){
solrSize
=
0
;
}
if
(
solrSize
==
0
){
//0表示数据源里没有
//再去基站信息表里查询一次,确保确定没有这条数据
List
<
TbStJzxx
>
list
=
tbStJzxxService
.
selectJzxxByAddressJW
(
trackList
.
get
(
i
).
getAddress
(),
trackList
.
get
(
i
).
getJ
(),
trackList
.
get
(
i
).
getW
());
if
(
list
.
size
()==
0
){
...
...
@@ -86,13 +94,15 @@ public class TrackDataJob implements BaseJob {
}
savecount
++;
}
}
//String str=trackList.get(i).toString();
//JSONObject jsonStr = JSONObject.parseObject(str);
// String json = HttpClientUtil.doPost(url+core+"/update?commitWithin=1000&overwrite=true&wt="+jsonStr);
// System.out.println(json);
}
System
.
out
.
println
(
"solr保存条数:"
+
savecount
);
System
.
out
.
println
(
"基站信息保存条数:"
+
jzxxcount
);
System
.
out
.
println
(
"
3:
solr保存条数:"
+
savecount
);
System
.
out
.
println
(
"
4:
基站信息保存条数:"
+
jzxxcount
);
}
//保存基站信息
...
...
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