Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
傅伟强-富德
/
test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 129ae299
authored
Jan 22, 2019
by
傅伟强-富德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test.txt
1 parent
0781b6e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
55 deletions
test.txt
test.txt
View file @
129ae29
...
@@ -303,64 +303,79 @@ filter {
...
@@ -303,64 +303,79 @@ filter {
Date startDate = null;
Date startDate = null;
Date nowDate = new Date();
boolean exists = redisUtil.exists(MyConstant.REDIS_GG_CHECKTIME);
boolean exists = redisUtil.exists(MyConstant.REDIS_GG_CHECKTIME);
Date nowDate=new Date();
//没有同步记录
//没有同步记录
try
if(!exists){
{
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
if (!exists)
startDate = new Date(nowDate.getTime() - 660000L);
{
}else{
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
//存在记录
startDate = df.parse("2018-01-01");
String lastGGTime = redisUtil.get(MyConstant.REDIS_GG_CHECKTIME).toString();
nowDate = df.parse("2018-02-01");
System.out.println("lastGGTime:"+lastGGTime);
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
startDate=DateUtil.getDateTimeFormat(lastGGTime.toString());
startDate = new Date(startDate.getTime() - 660000L);
//更新本次同步时间
}
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
else
}
{
//存在记录
String lastGGTime = redisUtil.get(MyConstant.REDIS_GG_CHECKTIME).toString();
this.logUtils.info("本次地址解析数据起始时间:" + startDate);
System.out.println("lastGGTime:" + lastGGTime);
// this.logUtils.info("本次地址解析数据结束时间:" + endDate);
startDate = DateUtil.getDateTimeFormat(lastGGTime);
try
//本次结束时间为上次结束时间增加一个月
{
nowDate=DateUtil.getDateTimeFormat(DateUtil.subMonth(lastGGTime));
List addressMapList = new ArrayList();
//更新本次同步时间
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
//Integer newPolicyCount = this.oraclePolicyService.countForNewPolicy(startDate);
}
//if ((newPolicyCount != null) && (newPolicyCount.intValue() != 0))
//{
List newPolices = this.oraclePolicyService.selectByDate(startDate);
this.logUtils.info("本次地址解析数据起始时间:" + startDate);
if(newPolices!=null && newPolices.size()>0){
this.logUtils.info("本次地址解析数据结束时间:" + nowDate);
try
{
List addressMapList = new ArrayList();
//List<Map<String,String>> newPolices = this.oraclePolicyService.selectByDate(startDate);
/* Map<Integer,List> policyMap=new HashMap<Integer,List>();
this.logUtils.info("增量--本次进行地址解析的总量是:" + newPolices.size());
handlePolicyList(addressMapList, newPolices);
policyMap= batchesSync(policyMap,newPolices,3000);*/
this.logUtils.info("增量--用于解析的地址的量是:" + addressMapList.size());
bulkGeocodingGeo(addressMapList);
addressMapList.clear();
List<Map<String,String>> newPolices=this.oraclePolicyService.getNewPolicyAddress(startDate, nowDate);
if (newPolices != null && newPolices.size() > 0)
if (this.failedAddressList.size() > 0)
{
{
this.logUtils.info("增量--解析之前网络原因无法解析的地址信息----" + this.failedAddressList.size() + "条数据");
this.logUtils.info("增量--本次进行地址解析的总量是:" + newPolices.size());
bulkGeocodingGeo(this.failedAddressList);
handlePolicyList(addressMapList, newPolices);
this.failedAddressList.clear();
this.logUtils.info("增量--用于解析的地址的量是:" + addressMapList.size());
}
bulkGeocodingGeo(addressMapList);
this.logUtils.info("增量--本次地址解析结束,共计解析地址:" + newPolices.size());
addressMapList.clear();
}else{
this.logUtils.info("增量--本次地址解析结束,共计解析地址:0");
if (this.failedAddressList.size() > 0)
}
{
//}
this.logUtils.info("增量--解析之前网络原因无法解析的地址信息----" + this.failedAddressList.size() + "条数据");
//新增的处理完 处理更新的数据
bulkGeocodingGeo(this.failedAddressList);
syncUpdatedGeo(startDate);
this.failedAddressList.clear();
}
}
catch (Exception e)
this.logUtils.info("增量--本次地址解析结束,共计解析地址:" + newPolices.size());
{
}
this.logUtils.error("syncPolicyGeo catch exception ==" + e);
else
}
{
this.logUtils.info("增量--本次地址解析结束,共计解析地址:0");
}
//新增的处理完 处理更新的数据
syncUpdatedGeo(startDate,nowDate);
}
catch (Exception e)
{
this.logUtils.error("syncPolicyGeo catch exception ==" + e);
}
}
catch (ParseException e)
{
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment