fixed issues 199 -3
parent
c2f427e354
commit
d19838fd32
|
@ -934,21 +934,13 @@ class MeterPointCollection:
|
||||||
raise falcon.HTTPError(falcon.HTTP_404, title='API.NOT_FOUND',
|
raise falcon.HTTPError(falcon.HTTP_404, title='API.NOT_FOUND',
|
||||||
description='API.POINT_NOT_FOUND')
|
description='API.POINT_NOT_FOUND')
|
||||||
if row[1] == 'ENERGY_VALUE':
|
if row[1] == 'ENERGY_VALUE':
|
||||||
query = (" SELECT point_id "
|
query = (" SELECT tmp.id,tmp.meter_id,tmp.point_id,tp.object_type "
|
||||||
" FROM tbl_meters_points "
|
" FROM tbl_meters_points tmp "
|
||||||
" WHERE meter_id = %s")
|
" LEFT JOIN tbl_points tp ON tmp.point_id = tp.id"
|
||||||
cursor.execute(query, (id_,))
|
" WHERE tmp.meter_id = %s AND tp.object_type = %s")
|
||||||
|
cursor.execute(query, (id_, 'ENERGY_VALUE',))
|
||||||
rows = cursor.fetchall()
|
rows = cursor.fetchall()
|
||||||
|
|
||||||
cursor.execute(" SELECT id "
|
|
||||||
" FROM tbl_points "
|
|
||||||
" WHERE object_type = %s ", ('ENERGY_VALUE',))
|
|
||||||
ponit_ids = cursor.fetchall()
|
|
||||||
|
|
||||||
if rows is not None:
|
if rows is not None:
|
||||||
if ponit_ids is not None:
|
|
||||||
for row1 in rows:
|
|
||||||
if row1 in ponit_ids:
|
|
||||||
cursor.close()
|
cursor.close()
|
||||||
cnx.disconnect()
|
cnx.disconnect()
|
||||||
raise falcon.HTTPError(falcon.HTTP_404, title='API.BAD_REQUEST',
|
raise falcon.HTTPError(falcon.HTTP_404, title='API.BAD_REQUEST',
|
||||||
|
|
Loading…
Reference in New Issue