Commit d5d5fbe2 authored by litaolemo's avatar litaolemo

update

parent 112d6543
......@@ -276,16 +276,14 @@ for res in sql_res:
if cl_id in device_id_dict:
# print("has device")
# print(type(card_id),card_id)
print("has card_id")
# print("has card_id")
session_pv = res.session_pv
# card_id_set.update(card_id)
if cl_id in second_demands_tag_dict:
for tag_id in second_demands_tag_dict[cl_id]:
if tag_id in second_demands_id_count:
print('+1')
second_demands_id_count[tag_id][int(card_id)] = 1
else:
print('0')
second_demands_id_count[tag_id] = {}
second_demands_id_count[tag_id][int(card_id)] = 1
......@@ -297,15 +295,14 @@ for res in sql_res:
if cl_id in projects_demands_tag_dict:
for tag_id in projects_demands_tag_dict[cl_id]:
if tag_id in projects_demands_id_count:
print('+1')
projects_demands_id_count[tag_id][int(card_id)] = 1
else:
print(0)
projects_demands_id_count[tag_id] = {}
projects_demands_id_count[tag_id][int(card_id)] = 1
final_projects_list = []
second_demands_list = []
for tag_id in second_demands_tag_count:
temp_dict = {
"tag_name": tag_id,
......@@ -315,13 +312,14 @@ for tag_id in second_demands_tag_count:
}
print(temp_dict)
print(1)
for tag_id in second_demands_count_dict:
if tag_id not in second_demands_tag_count:
temp_dict = {
"tag_name": tag_id,
"device_count": second_demands_tag_count.get(tag_id),
"tractate_count": second_demands_count_dict.get(tag_id),
"exporsure_count": len(second_demands_id_count[tag_id]) if second_demands_id_count.get(tag_id) else 0,
"exporsure_count": 0,
}
print(temp_dict)
......@@ -332,10 +330,11 @@ for tag_id in projects_demands_tag_count:
"tag_name": tag_id,
"device_count": projects_demands_tag_count[tag_id],
"tractate_count": tags_v3_count_dict.get(tag_id),
"exporsure_count": 0,
"exporsure_count": len(second_demands_id_count[tag_id]) if second_demands_id_count.get(tag_id) else 0,
}
print(temp_dict)
print(2)
for tag_id in tags_v3_count_dict:
if tag_id not in projects_demands_tag_count:
temp_dict = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment