Commit f46722a1 by yinyong

Merge remote-tracking branch 'origin/master'

parents 10027929 25e8c298
...@@ -123,8 +123,10 @@ public class WishSyncJob extends PointJob { ...@@ -123,8 +123,10 @@ public class WishSyncJob extends PointJob {
for(Map<String, DcBaseFinanceWish> maps : mapList) { for(Map<String, DcBaseFinanceWish> maps : mapList) {
DcBaseFinanceWish dcBaseFinanceWish = null; DcBaseFinanceWish dcBaseFinanceWish = null;
boolean updateInsert = true; boolean updateInsert = true;
boolean afterTime = false;
try { try {
dcBaseFinanceWish = maps.get("Campaign"); dcBaseFinanceWish = maps.get("Campaign");
if(jobAccountLog.getStartTime().compareTo(dcBaseFinanceWish.getStartTime()) > -1) {
BigDecimal exchangeRate = CallBailunSystem.getExchangeRate(CurrencyType.USD.value(), CurrencyType.CNY.value(), dcBaseFinanceWish.getStartTime()); BigDecimal exchangeRate = CallBailunSystem.getExchangeRate(CurrencyType.USD.value(), CurrencyType.CNY.value(), dcBaseFinanceWish.getStartTime());
dcBaseFinanceWish.setOtherToCnyExchangeRate(exchangeRate); dcBaseFinanceWish.setOtherToCnyExchangeRate(exchangeRate);
dcBaseFinanceWish.setAccountId(jobAccountLog.getAccountId()); dcBaseFinanceWish.setAccountId(jobAccountLog.getAccountId());
...@@ -142,6 +144,8 @@ public class WishSyncJob extends PointJob { ...@@ -142,6 +144,8 @@ public class WishSyncJob extends PointJob {
} }
updateInsert = false; updateInsert = false;
} }
afterTime = true;
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e); throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
...@@ -149,6 +153,7 @@ public class WishSyncJob extends PointJob { ...@@ -149,6 +153,7 @@ public class WishSyncJob extends PointJob {
SessionUtil.closeSession(); SessionUtil.closeSession();
} }
try { try {
if(afterTime) {
List<Map<String, DcBaseFinanceWishProduct>> listWishProduct = maps.get("Campaign").getListWishProduct(); List<Map<String, DcBaseFinanceWishProduct>> listWishProduct = maps.get("Campaign").getListWishProduct();
if(updateInsert) { if(updateInsert) {
DcBaseFinanceWishProductMapper dcBaseFinanceWishProductMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishProductMapper.class); DcBaseFinanceWishProductMapper dcBaseFinanceWishProductMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishProductMapper.class);
...@@ -162,6 +167,7 @@ public class WishSyncJob extends PointJob { ...@@ -162,6 +167,7 @@ public class WishSyncJob extends PointJob {
dcBaseFinanceWishProductMapper.insertSelective(dcBaseFinanceWishProduct); dcBaseFinanceWishProductMapper.insertSelective(dcBaseFinanceWishProduct);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e); throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
...@@ -170,6 +176,7 @@ public class WishSyncJob extends PointJob { ...@@ -170,6 +176,7 @@ public class WishSyncJob extends PointJob {
} }
try { try {
if(afterTime) {
if(updateInsert) { if(updateInsert) {
DcBaseFinanceWishImpressionFeeMapper dcBaseFinanceWishImpressionFeeMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishImpressionFeeMapper.class); DcBaseFinanceWishImpressionFeeMapper dcBaseFinanceWishImpressionFeeMapper = SessionUtil.getSession().getMapper(DcBaseFinanceWishImpressionFeeMapper.class);
dcBaseFinanceWishImpressionFeeMapper.deleteByExample(DcBaseFinanceWishImpressionFeeExample.newAndCreateCriteria().andCampaignIdEqualTo(dcBaseFinanceWish.getCampaignId()).example()); dcBaseFinanceWishImpressionFeeMapper.deleteByExample(DcBaseFinanceWishImpressionFeeExample.newAndCreateCriteria().andCampaignIdEqualTo(dcBaseFinanceWish.getCampaignId()).example());
...@@ -183,6 +190,7 @@ public class WishSyncJob extends PointJob { ...@@ -183,6 +190,7 @@ public class WishSyncJob extends PointJob {
dcBaseFinanceWishImpressionFeeMapper.insertSelective(dcBaseFinanceWishImpressionFee); dcBaseFinanceWishImpressionFeeMapper.insertSelective(dcBaseFinanceWishImpressionFee);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e); 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