main.py 938 B

123456789101112131415161718192021222324252627
  1. #coding=utf-8
  2. import os
  3. import datetime
  4. import pandas as pd
  5. from LIB.BACKEND import DBManager, Log
  6. from LIB.MIDDLE import SignalMonitor
  7. from sqlalchemy import create_engine
  8. from sqlalchemy.orm import sessionmaker
  9. import time, datetime
  10. import traceback
  11. from LIB.MIDDLE.DeltSoc import LFPDeltSoc20210804 as LFPDeltSoc
  12. from urllib import parse
  13. dbManager = DBManager.DBManager()
  14. if __name__ == "__main__":
  15. SNdata_6060 = pd.read_excel('骑享资产梳理-20210621.xlsx', sheet_name='6060')
  16. SNnums_6060=SNdata_6060['SN号']
  17. now_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  18. now_time=datetime.datetime.strptime(now_time,'%Y-%m-%d %H:%M:%S')
  19. start_time=now_time-datetime.timedelta(days=31)
  20. end_time=str(now_time)
  21. start_time=str(start_time)
  22. for sn in SNnums_6060.tolist():
  23. res = LFPDeltSoc.cal_deltsoc(sn, end_time, start_time)
  24. res.to_csv('BMS_DetaSoc_'+sn+'.csv',encoding='GB18030')