Commit 129ae299 by 傅伟强-富德

Update test.txt

1 parent 0781b6e4
Showing with 33 additions and 18 deletions
...@@ -303,38 +303,48 @@ filter { ...@@ -303,38 +303,48 @@ 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();
//没有同步记录 //没有同步记录
if(!exists){ try
{
if (!exists)
{
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
startDate = df.parse("2018-01-01");
nowDate = df.parse("2018-02-01");
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate)); redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
startDate = new Date(nowDate.getTime() - 660000L); startDate = new Date(startDate.getTime() - 660000L);
}else{ }
else
{
//存在记录 //存在记录
String lastGGTime = redisUtil.get(MyConstant.REDIS_GG_CHECKTIME).toString(); String lastGGTime = redisUtil.get(MyConstant.REDIS_GG_CHECKTIME).toString();
System.out.println("lastGGTime:"+lastGGTime); System.out.println("lastGGTime:" + lastGGTime);
startDate=DateUtil.getDateTimeFormat(lastGGTime.toString()); startDate = DateUtil.getDateTimeFormat(lastGGTime);
//本次结束时间为上次结束时间增加一个月
nowDate=DateUtil.getDateTimeFormat(DateUtil.subMonth(lastGGTime));
//更新本次同步时间 //更新本次同步时间
redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate)); redisUtil.set(MyConstant.REDIS_GG_CHECKTIME, DateUtil.getDateTimeFormat(nowDate));
} }
this.logUtils.info("本次地址解析数据起始时间:" + startDate); this.logUtils.info("本次地址解析数据起始时间:" + startDate);
// this.logUtils.info("本次地址解析数据结束时间:" + endDate); this.logUtils.info("本次地址解析数据结束时间:" + nowDate);
try try
{ {
List addressMapList = new ArrayList(); List addressMapList = new ArrayList();
//Integer newPolicyCount = this.oraclePolicyService.countForNewPolicy(startDate); //List<Map<String,String>> newPolices = this.oraclePolicyService.selectByDate(startDate);
/* Map<Integer,List> policyMap=new HashMap<Integer,List>();
//if ((newPolicyCount != null) && (newPolicyCount.intValue() != 0))
//{
List newPolices = this.oraclePolicyService.selectByDate(startDate); policyMap= batchesSync(policyMap,newPolices,3000);*/
if(newPolices!=null && newPolices.size()>0){
List<Map<String,String>> newPolices=this.oraclePolicyService.getNewPolicyAddress(startDate, nowDate);
if (newPolices != null && newPolices.size() > 0)
{
this.logUtils.info("增量--本次进行地址解析的总量是:" + newPolices.size()); this.logUtils.info("增量--本次进行地址解析的总量是:" + newPolices.size());
handlePolicyList(addressMapList, newPolices); handlePolicyList(addressMapList, newPolices);
...@@ -349,18 +359,23 @@ filter { ...@@ -349,18 +359,23 @@ filter {
this.failedAddressList.clear(); this.failedAddressList.clear();
} }
this.logUtils.info("增量--本次地址解析结束,共计解析地址:" + newPolices.size()); this.logUtils.info("增量--本次地址解析结束,共计解析地址:" + newPolices.size());
}else{ }
else
{
this.logUtils.info("增量--本次地址解析结束,共计解析地址:0"); this.logUtils.info("增量--本次地址解析结束,共计解析地址:0");
} }
//}
//新增的处理完 处理更新的数据 //新增的处理完 处理更新的数据
syncUpdatedGeo(startDate); syncUpdatedGeo(startDate,nowDate);
} }
catch (Exception e) catch (Exception e)
{ {
this.logUtils.error("syncPolicyGeo catch exception ==" + e); this.logUtils.error("syncPolicyGeo catch exception ==" + e);
} }
}
catch (ParseException e)
{
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!