@ -2,6 +2,7 @@ package com.baiyee.adcallback.task;
import cn.hutool.core.collection.CollUtil ;
import cn.hutool.core.convert.Convert ;
import cn.hutool.core.date.DateTime ;
import cn.hutool.core.date.DateUtil ;
import cn.hutool.core.text.csv.CsvWriter ;
import cn.hutool.core.util.RandomUtil ;
@ -56,13 +57,13 @@ public class TfSourceTask {
@Transactional ( rollbackFor = Exception . class )
public void tfSource ( ) {
log . info ( "++++++++++++++++++++++TfSource Sync start time {} ++++++++++++++++" , DateUtil . now ( ) ) ;
String startTime = DateUtil . format ( DateUtil . yesterday ( ) , "yyyy-MM-dd 00:00:00" ) ;
String endTime = DateUtil . format ( DateUtil . yesterday ( ) , "yyyy-MM-dd 23:59:59" ) ;
DateTime startTime = DateUtil . beginOfDay ( DateUtil . yesterday ( ) ) ;
DateTime endTime = DateUtil . endOfDay ( DateUtil . yesterday ( ) ) ;
List < TfSourceDTO > list = new ArrayList < > ( ) ;
//jlv2
obtainDateByJlV2 ( startTime , endTime , list ) ;
//jlv1
obtainDateByJlv1 ( startTime , endTime , list ) ;
//jlv2
obtainDateByJlV2 ( startTime , endTime , list ) ;
//gdt
obtainDateByGdt ( startTime , endTime , list ) ;
//ks
@ -100,7 +101,7 @@ public class TfSourceTask {
* @param list
* /
private String generateFile ( String tag , String format , String password , List < TfSourceDTO > list ) {
String filePath = path + format;
String filePath = path + File. separator + format;
File file = new File ( filePath + File . separator + tag + ".csv" ) ;
CsvWriter writer = new CsvWriter ( file , StandardCharsets . UTF_8 ) ;
writer . writeBeans ( list ) ;
@ -140,7 +141,7 @@ public class TfSourceTask {
return null ;
}
private void obtainDateByJlV2 ( String startTime , String endTime , List < TfSourceDTO > list ) {
private void obtainDateByJlV2 ( DateTime startTime , DateTime endTime , List < TfSourceDTO > list ) {
List < TbJLBackDataV2Entity > jlV2Data = tbJLV2BackdataEntityRepository . queryByDate ( startTime , endTime ) ;
if ( CollUtil . isNotEmpty ( jlV2Data ) ) {
List < TfSourceDTO > tfSourceDTOS = Convert . toList ( TfSourceDTO . class , jlV2Data ) ;
@ -148,7 +149,7 @@ public class TfSourceTask {
}
}
private void obtainDateByJlv1 ( String startTime , String endTime , List < TfSourceDTO > list ) {
private void obtainDateByJlv1 ( DateTime startTime , DateTime endTime , List < TfSourceDTO > list ) {
List < TbJLBackDataV1Entity > jlV1Data = tbJLV1BackdataEntityRepository . queryByDate ( startTime , endTime ) ;
if ( CollUtil . isNotEmpty ( jlV1Data ) ) {
List < TfSourceDTO > tfSourceDTOS = Convert . toList ( TfSourceDTO . class , jlV1Data ) ;
@ -156,7 +157,7 @@ public class TfSourceTask {
}
}
private void obtainDateByGdt ( String startTime , String endTime , List < TfSourceDTO > list ) {
private void obtainDateByGdt ( DateTime startTime , DateTime endTime , List < TfSourceDTO > list ) {
List < TbGdtNewBackdataEntity > jlV2Data = tbGdtNewBackdataEntityRepository . queryByDate ( startTime , endTime ) ;
if ( CollUtil . isNotEmpty ( jlV2Data ) ) {
List < TfSourceDTO > tfSourceDTOS = Convert . toList ( TfSourceDTO . class , jlV2Data ) ;
@ -164,7 +165,7 @@ public class TfSourceTask {
}
}
private void obtainDateByKs ( String startTime , String endTime , List < TfSourceDTO > list ) {
private void obtainDateByKs ( DateTime startTime , DateTime endTime , List < TfSourceDTO > list ) {
List < TbKSNewBackdataEntity > jlV2Data = tbKSNewBackdataEntityRepository . queryByDate ( startTime , endTime ) ;
if ( CollUtil . isNotEmpty ( jlV2Data ) ) {
List < TfSourceDTO > tfSourceDTOS = Convert . toList ( TfSourceDTO . class , jlV2Data ) ;
@ -172,7 +173,7 @@ public class TfSourceTask {
}
}
private void obtainDateByBd ( String startTime , String endTime , List < TfSourceDTO > list ) {
private void obtainDateByBd ( DateTime startTime , DateTime endTime , List < TfSourceDTO > list ) {
List < TbBdNewBackdataEntity > jlV2Data = tbBDNewBackdataEntityRepository . queryByDate ( startTime , endTime ) ;
if ( CollUtil . isNotEmpty ( jlV2Data ) ) {
List < TfSourceDTO > tfSourceDTOS = Convert . toList ( TfSourceDTO . class , jlV2Data ) ;