对于电表的总电量,如果获取时间是59分59秒,加1秒,变成下一个小时
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mingsheng.li 2025-08-22 15:47:22 +08:00
parent 8b0bb6e753
commit 59f6526cca

View File

@ -167,6 +167,10 @@ class DbfToPostgresCtllogPwcPipeline(BasePipeline):
if created is None or real_value is None:
continue
# 对于总用电量,如果正好是 59 分 59 秒,则加 1 秒
if data_field == "TOTALIZE" and created.minute == 59 and created.second == 59:
created += timedelta(seconds=1)
created = created - timedelta(hours=8)
created_str = created.strftime('%Y-%m-%d %H:%M:%S') + '+00'