Merge branch 'develop'

pull/142/MERGE
13621160019@163.com 2022-03-24 19:08:03 +08:00
commit 301dff6f49
19 changed files with 116 additions and 116 deletions

View File

@ -250,20 +250,20 @@ def main(logger):
break break
# end of for combined equipment loop # end of for combined equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -250,20 +250,20 @@ def main(logger):
break break
# end of for combined equipment loop # end of for combined equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -250,20 +250,20 @@ def main(logger):
break break
# end of for combined equipment loop # end of for combined equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for equipment loop # end of for equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for equipment loop # end of for equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for equipment loop # end of for equipment loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -246,20 +246,20 @@ def main(logger):
break break
# end of for meter loop # end of for meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -247,20 +247,20 @@ def main(logger):
break break
# end of for meter loop # end of for meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
if cursor_carbon_db: if cursor_carbon_db:
cursor_carbon_db.close() cursor_carbon_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -246,20 +246,20 @@ def main(logger):
break break
# end of for offline_meter loop # end of for offline_meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -247,20 +247,20 @@ def main(logger):
break break
# end of for offline meter loop # end of for offline meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
if cursor_carbon_db: if cursor_carbon_db:
cursor_carbon_db.close() cursor_carbon_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for shopfloor loop # end of for shopfloor loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for shopfloor loop # end of for shopfloor loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for store loop # end of for store loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -249,20 +249,20 @@ def main(logger):
break break
# end of for store loop # end of for store loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -36,10 +36,10 @@ def get_energy_category_tariffs(cost_center_id, energy_category_id, start_dateti
rows_tariffs = cursor.fetchall() rows_tariffs = cursor.fetchall()
except Exception as e: except Exception as e:
print(str(e)) print(str(e))
if cnx:
cnx.close()
if cursor: if cursor:
cursor.close() cursor.close()
if cnx:
cnx.close()
return dict() return dict()
if rows_tariffs is None or len(rows_tariffs) == 0: if rows_tariffs is None or len(rows_tariffs) == 0:
@ -63,10 +63,10 @@ def get_energy_category_tariffs(cost_center_id, energy_category_id, start_dateti
rows_timeofuse_tariffs = cursor.fetchall() rows_timeofuse_tariffs = cursor.fetchall()
except Exception as e: except Exception as e:
print(str(e)) print(str(e))
if cnx:
cnx.close()
if cursor: if cursor:
cursor.close() cursor.close()
if cnx:
cnx.close()
return dict() return dict()
if cursor: if cursor:
@ -137,10 +137,10 @@ def get_energy_item_tariffs(cost_center_id, energy_item_id, start_datetime_utc,
rows_tariffs = cursor.fetchall() rows_tariffs = cursor.fetchall()
except Exception as e: except Exception as e:
print(str(e)) print(str(e))
if cnx:
cnx.close()
if cursor: if cursor:
cursor.close() cursor.close()
if cnx:
cnx.close()
return dict() return dict()
if rows_tariffs is None or len(rows_tariffs) == 0: if rows_tariffs is None or len(rows_tariffs) == 0:
@ -164,10 +164,10 @@ def get_energy_item_tariffs(cost_center_id, energy_item_id, start_datetime_utc,
rows_timeofuse_tariffs = cursor.fetchall() rows_timeofuse_tariffs = cursor.fetchall()
except Exception as e: except Exception as e:
print(str(e)) print(str(e))
if cnx:
cnx.close()
if cursor: if cursor:
cursor.close() cursor.close()
if cnx:
cnx.close()
return dict() return dict()
if cursor: if cursor:

View File

@ -248,20 +248,20 @@ def main(logger):
break break
# end of for tenant loop # end of for tenant loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -248,20 +248,20 @@ def main(logger):
break break
# end of for tenant loop # end of for tenant loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -246,20 +246,20 @@ def main(logger):
break break
# end of for virtual_meter loop # end of for virtual_meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_billing_db:
cnx_billing_db.close()
if cursor_billing_db: if cursor_billing_db:
cursor_billing_db.close() cursor_billing_db.close()
if cnx_billing_db:
cnx_billing_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")

View File

@ -247,20 +247,20 @@ def main(logger):
break break
# end of for virtual_meter loop # end of for virtual_meter loop
if cnx_system_db:
cnx_system_db.close()
if cursor_system_db: if cursor_system_db:
cursor_system_db.close() cursor_system_db.close()
if cnx_system_db:
cnx_system_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cursor_energy_db: if cursor_energy_db:
cursor_energy_db.close() cursor_energy_db.close()
if cnx_energy_db:
cnx_energy_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
if cursor_carbon_db: if cursor_carbon_db:
cursor_carbon_db.close() cursor_carbon_db.close()
if cnx_carbon_db:
cnx_carbon_db.close()
print("go to sleep 300 seconds...") print("go to sleep 300 seconds...")
time.sleep(300) time.sleep(300)
print("wake from sleep, and continue to work...") print("wake from sleep, and continue to work...")