main.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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_6040 = pd.read_excel('骑享资产梳理-20210621.xlsx', sheet_name='6040骑享')
  17. SNdata_6060 = pd.read_excel('骑享资产梳理-20210621.xlsx', sheet_name='6060')
  18. SNnums_6060=SNdata_6060['SN号']
  19. SNnums_6040=SNdata_6040['SN号']
  20. now_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
  21. now_time=datetime.datetime.strptime(now_time,'%Y-%m-%d %H:%M:%S')
  22. start_time=now_time-datetime.timedelta(days=1)
  23. end_time=str(now_time)
  24. start_time=str(start_time)
  25. for sn in SNnums_6040.tolist():
  26. res = NCMSoh.cal_soh(sn, end_time, start_time)
  27. res.to_csv('BMS_SOH_'+sn+'.csv',encoding='GB18030')
  28. for sn in SNnums_6060.tolist():
  29. res = LFPSoh.cal_soh(sn, end_time, start_time)
  30. res.to_csv('BMS_SOH_'+sn+'.csv',encoding='GB18030')