From 667af2e8a76325c4f83fd70f17983abe6b2c677a Mon Sep 17 00:00:00 2001 From: happyZYM Date: Fri, 24 May 2024 18:11:48 +0000 Subject: [PATCH] basically fix query time error --- CMakeLists.txt | 2 +- src/include/stop_register.hpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ecd956..7fe65e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fsanitize=address -fsanitize=undefined -fsanitize=leak") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -fsanitize=address -fsanitize=undefined -fsanitize=leak") # 执行git命令检查是否有未存档的更改 execute_process( diff --git a/src/include/stop_register.hpp b/src/include/stop_register.hpp index 3aa23bf..055ff63 100644 --- a/src/include/stop_register.hpp +++ b/src/include/stop_register.hpp @@ -147,7 +147,9 @@ class StopRegister : public DataDriverBase { entry.arrive_time_stamp = entry.actual_start_date * 1440 + startTime + (*reinterpret_cast(&value_to)).vis_time_offset; entry.to_stop_id = key_to.stop_id; - res.push_back(entry); + // LOG->debug("leave_time_stamp {} arrive_time_stamp {}", entry.leave_time_stamp, entry.arrive_time_stamp); + if (entry.leave_time_stamp < entry.arrive_time_stamp) res.push_back(entry); + // res.push_back(entry); ++it_to; break; } @@ -175,6 +177,11 @@ class StopRegister : public DataDriverBase { } const auto &value_from = it_from.GetValue(); const auto &value_to = it_to.GetValue(); + if ((*reinterpret_cast(&value_from)).vis_time_offset > + (*reinterpret_cast(&value_to)).vis_time_offset) { + success = false; + return; + } int true_saleDate_beg = (*reinterpret_cast(&value_from)).saleDate_beg + June_1st_2024; int true_saleDate_end = (*reinterpret_cast(&value_from)).saleDate_end + June_1st_2024; int leave_time_offset = (*reinterpret_cast(&value_from)).vis_time_offset;