main.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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.soh import NCMSoh_20210716 as NCMSoh
  12. from LIB.MIDDLE.soh import LFPSoh_20210711 as LFPSoh
  13. from urllib import parse
  14. dbManager = DBManager.DBManager()
  15. if __name__ == "__main__":
  16. SNdata = pd.read_excel('骑享资产梳理-20210621.xlsx', sheet_name='6040骑享')
  17. SNnums=SNdata['SN号']
  18. now_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  19. now_time=datetime.datetime.strptime(now_time,'%Y-%m-%d %H:%M:%S')
  20. start_time=now_time-datetime.timedelta(days=1)
  21. end_time=str(now_time)
  22. start_time=str(start_time)
  23. for sn in SNnums.tolist():
  24. res = NCMSoh.cal_soh(sn, end_time, start_time)
  25. res.to_csv('BMS_SOH_'+sn+'.csv',encoding='GB18030')
  26. for sn in SNnums.tolist():
  27. res = LFPSoh.cal_soh(sn, end_time, start_time)
  28. res.to_csv('BMS_SOH_'+sn+'.csv',encoding='GB18030')