1.暂态同步程序提交

This commit is contained in:
wr
2024-12-06 14:06:02 +08:00
parent 47518928e0
commit 6518adc8ce

View File

@@ -17,7 +17,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.Collections; import java.util.Collections;
@@ -107,10 +109,10 @@ public class OracleToInfluxDBController {
LocalDateTime startDate = LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(startDateTime, DatePattern.NORM_DATE_PATTERN)); LocalDateTime startDate = LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(startDateTime, DatePattern.NORM_DATE_PATTERN));
LocalDateTime endDate = LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(endDateTime, DatePattern.NORM_DATE_PATTERN)); LocalDateTime endDate = LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(endDateTime, DatePattern.NORM_DATE_PATTERN));
long betweenDay = LocalDateTimeUtil.between(startDate, endDate, ChronoUnit.DAYS); long betweenDay = LocalDateTimeUtil.between(startDate, endDate, ChronoUnit.DAYS);
oracleEventDetailToMysqlService.eventBatch(startDate, endDate); oracleEventDetailToMysqlService.eventBatch(startDate, LocalDateTime.of(LocalDate.from(startDate), LocalTime.MAX));
for (int i = 0; i <=betweenDay; i++) { for (int i = 0; i <=betweenDay; i++) {
startDate = LocalDateTimeUtil.offset(startDate, 1, ChronoUnit.DAYS); startDate = LocalDateTimeUtil.offset(startDate, 1, ChronoUnit.DAYS);
oracleEventDetailToMysqlService.eventBatch(startDate, endDate); oracleEventDetailToMysqlService.eventBatch(startDate, LocalDateTime.of(LocalDate.from(startDate), LocalTime.MAX));
} }
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();