定时备份数据代码修改

master
yqyg16603827325@126.com 3 years ago
parent e08fa016ea
commit 361b0ed1a2

@ -22,9 +22,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -63,6 +61,7 @@ public class ObtainInfoServiceImpl implements ObtainInfoService {
client = new DefaultTaobaoClient(miProperties.getServerUrl(), miProperties.getAppKey(), miProperties.getAppSecret()); client = new DefaultTaobaoClient(miProperties.getServerUrl(), miProperties.getAppKey(), miProperties.getAppSecret());
AtomicInteger count = new AtomicInteger(); AtomicInteger count = new AtomicInteger();
List<TopTrade> allByGmtSync = topTradeRepository.findAllByGmtSync(); List<TopTrade> allByGmtSync = topTradeRepository.findAllByGmtSync();
log.info("===============ObtainInfoJob同步前一天数据应插入条数{}===============",allByGmtSync.size());
if (allByGmtSync.size() > 0) { if (allByGmtSync.size() > 0) {
allByGmtSync.stream().forEach(ac ->{ allByGmtSync.stream().forEach(ac ->{
UserOaidInfo userOaidInfo = new UserOaidInfo(); UserOaidInfo userOaidInfo = new UserOaidInfo();
@ -89,6 +88,7 @@ public class ObtainInfoServiceImpl implements ObtainInfoService {
} }
} }
}); });
log.info("===============ObtainInfoJob同步前一天实际插入数据条数{}===============",count.get());
//插入存入记录 //插入存入记录
saveObtainInfoRecord(0,allByGmtSync.size(),count.get()); saveObtainInfoRecord(0,allByGmtSync.size(),count.get());
} }
@ -149,7 +149,7 @@ public class ObtainInfoServiceImpl implements ObtainInfoService {
List<TopOaidDecryptResponse.Receiver> receiverList = rsp.getReceiverList(); List<TopOaidDecryptResponse.Receiver> receiverList = rsp.getReceiverList();
return receiverList.get(0); return receiverList.get(0);
}catch (Exception e){ }catch (Exception e){
log.info("===========解密oaid失败========"); log.info("=========== 解密oaid失败oaid:{}, sessionKey:{}========",oaid,sessionKey);
return null; return null;
} }
} }

Loading…
Cancel
Save