Commit a692b023 by yinyong@bailuntec.com

修改开始时间在查询日期之后才插入数据库

parent 10f8b6e2
......@@ -123,8 +123,10 @@ public class WishSyncJob extends PointJob {
for(Map<String, DcBaseFinanceWish> maps : mapList) {
DcBaseFinanceWish dcBaseFinanceWish = null;
boolean updateInsert = true;
boolean afterTime = false;
try {
dcBaseFinanceWish = maps.get("Campaign");
if(dcBaseFinanceWish.getStartTime().compareTo(jobAccountLog.getStartTime()) > -1) {
BigDecimal exchangeRate = CallBailunSystem.getExchangeRate(CurrencyType.USD.value(), CurrencyType.CNY.value(), dcBaseFinanceWish.getStartTime());
dcBaseFinanceWish.setOtherToCnyExchangeRate(exchangeRate);
dcBaseFinanceWish.setAccountId(jobAccountLog.getAccountId());
......@@ -142,6 +144,8 @@ public class WishSyncJob extends PointJob {
}
updateInsert = false;
}
afterTime = true;
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
......@@ -149,6 +153,7 @@ public class WishSyncJob extends PointJob {
SessionUtil.closeSession();
}
try {
if(afterTime) {
List<Map<String, DcBaseFinanceWishProduct>> listWishProduct = maps.get("Campaign").getListWishProduct();
if(updateInsert) {
DcBaseFinanceWishProductMapper dcBaseFinanceWishProductMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishProductMapper.class);
......@@ -162,6 +167,7 @@ public class WishSyncJob extends PointJob {
dcBaseFinanceWishProductMapper.insertSelective(dcBaseFinanceWishProduct);
}
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
......@@ -170,6 +176,7 @@ public class WishSyncJob extends PointJob {
}
try {
if(afterTime) {
if(updateInsert) {
DcBaseFinanceWishImpressionFeeMapper dcBaseFinanceWishImpressionFeeMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishImpressionFeeMapper.class);
dcBaseFinanceWishImpressionFeeMapper.deleteByExample(DcBaseFinanceWishImpressionFeeExample.newAndCreateCriteria().andCampaignIdEqualTo(dcBaseFinanceWish.getCampaignId()).example());
......@@ -183,6 +190,7 @@ public class WishSyncJob extends PointJob {
dcBaseFinanceWishImpressionFeeMapper.insertSelective(dcBaseFinanceWishImpressionFee);
}
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment