|
|
@@ -79,16 +79,17 @@ class PestImageSourceExport(ListView):
|
|
|
else:
|
|
|
pest_dict[pest_name] = 1
|
|
|
else:
|
|
|
- for index,result in enumerate(indentify_result.split("#")) :
|
|
|
- if index != 0:
|
|
|
- pest_string += "、"
|
|
|
- tuple_result = result.split(",")
|
|
|
- pest_name = insect_dict.get(tuple_result[0],"未命名")
|
|
|
- pest_string+=pest_name
|
|
|
- try:
|
|
|
- pest_dict[pest_name] = int(tuple_result[1])
|
|
|
- except:
|
|
|
- pass
|
|
|
+ if indentify_result != "0":
|
|
|
+ for index,result in enumerate(indentify_result.split("#")) :
|
|
|
+ if index != 0:
|
|
|
+ pest_string += "、"
|
|
|
+ tuple_result = result.split(",")
|
|
|
+ pest_name = insect_dict.get(tuple_result[0],"未命名")
|
|
|
+ pest_string+=pest_name
|
|
|
+ try:
|
|
|
+ pest_dict[pest_name] = int(tuple_result[1])
|
|
|
+ except:
|
|
|
+ pass
|
|
|
if select_name and select_name not in pest_string:
|
|
|
continue
|
|
|
addtime = photo_object.addtime
|
|
|
@@ -111,7 +112,14 @@ class PestImageSourceExport(ListView):
|
|
|
uptime = datetime.datetime.fromtimestamp(data.get("addtime")).strftime("%Y-%m-%d %H:%M:%S")
|
|
|
save_data["上报时间"].append(uptime)
|
|
|
save_data["设备位置"].append(data.get("location"))
|
|
|
- save_data["图像"].append(config_dict["image_url"]["discern"] + data.get("indentify_photo"))
|
|
|
+ ind_url = data.get("indentify_photo")
|
|
|
+ if ind_url:
|
|
|
+ if ind_url.startswith("http"):
|
|
|
+ save_data["图像"].append(ind_url)
|
|
|
+ else:
|
|
|
+ save_data["图像"].append(config_dict["image_url"]["discern"] + ind_url)
|
|
|
+ else:
|
|
|
+ save_data["图像"].append("")
|
|
|
df = pd.DataFrame(data=save_data)
|
|
|
output = BytesIO()
|
|
|
df.to_excel(output,index=False)
|