|
|
@ -48,16 +48,16 @@ public class TfSourceTask {
|
|
|
|
private String path;
|
|
|
|
private String path;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 每天晚上23点 30分
|
|
|
|
* 每天凌晨1点 统计前一天的数据
|
|
|
|
* <p>
|
|
|
|
* <p>
|
|
|
|
* 所有今天的数据压缩成投放包
|
|
|
|
* 所有今天的数据压缩成投放包
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Scheduled(cron = "0 30 23 * * ? ")
|
|
|
|
@Scheduled(cron = "0 0 1 * * ? ")
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void tfSource() {
|
|
|
|
public void tfSource() {
|
|
|
|
log.info("++++++++++++++++++++++TfSource Sync start time {} ++++++++++++++++", DateUtil.now());
|
|
|
|
log.info("++++++++++++++++++++++TfSource Sync start time {} ++++++++++++++++", DateUtil.now());
|
|
|
|
String startTime = DateUtil.format(DateUtil.date(), "yyyy-MM-dd 00:00:00");
|
|
|
|
String startTime = DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd 00:00:00");
|
|
|
|
String endTime = DateUtil.format(DateUtil.date(), "yyyy-MM-dd 23:59:59");
|
|
|
|
String endTime = DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd 23:59:59");
|
|
|
|
List<TfSourceDTO> list = new ArrayList<>();
|
|
|
|
List<TfSourceDTO> list = new ArrayList<>();
|
|
|
|
//jlv2
|
|
|
|
//jlv2
|
|
|
|
obtainDateByJlV2(startTime, endTime, list);
|
|
|
|
obtainDateByJlV2(startTime, endTime, list);
|
|
|
@ -76,7 +76,7 @@ public class TfSourceTask {
|
|
|
|
//tag分组
|
|
|
|
//tag分组
|
|
|
|
HashMap<String, List<TfSourceDTO>> mapByTag = new HashMap<>(list.stream().collect(Collectors.groupingBy(TfSourceDTO::getTag, Collectors.toList())));
|
|
|
|
HashMap<String, List<TfSourceDTO>> mapByTag = new HashMap<>(list.stream().collect(Collectors.groupingBy(TfSourceDTO::getTag, Collectors.toList())));
|
|
|
|
|
|
|
|
|
|
|
|
String format = DateUtil.format(DateUtil.date(), "yyyy-MM-dd");
|
|
|
|
String format = DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd");
|
|
|
|
List<TbTfSourceEntity> saveList = new ArrayList<>();
|
|
|
|
List<TbTfSourceEntity> saveList = new ArrayList<>();
|
|
|
|
for (String tag : mapByTag.keySet()) {
|
|
|
|
for (String tag : mapByTag.keySet()) {
|
|
|
|
String password = RandomUtil.randomString(6);
|
|
|
|
String password = RandomUtil.randomString(6);
|
|
|
@ -92,6 +92,7 @@ public class TfSourceTask {
|
|
|
|
log.info("++++++++++++++++++++++TfSource Sync end time {} ++++++++++++++++", DateUtil.now());
|
|
|
|
log.info("++++++++++++++++++++++TfSource Sync end time {} ++++++++++++++++", DateUtil.now());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 生成文件
|
|
|
|
* 生成文件
|
|
|
|
*
|
|
|
|
*
|
|
|
|