|
|
@@ -529,12 +529,13 @@ def pest_raise_info(request):
|
|
|
else:
|
|
|
for result in indentify_result.split("#"):
|
|
|
tuple_result = result.split(",")
|
|
|
- pest_name = insect_dict.get(tuple_result[0],"未命名")
|
|
|
- pest_num = int(tuple_result[1])
|
|
|
- if pest_name in pest_day_info:
|
|
|
- pest_day_info[pest_name]["highNum"] += pest_num
|
|
|
- else:
|
|
|
- pest_day_info[pest_name] = {"startTime":time_serialize,"highTime":time_serialize,"endTime":time_serialize,"highNum":pest_num}
|
|
|
+ if len(tuple_result) == 2:
|
|
|
+ pest_name = insect_dict.get(tuple_result[0],"未命名")
|
|
|
+ pest_num = int(tuple_result[1])
|
|
|
+ if pest_name in pest_day_info:
|
|
|
+ pest_day_info[pest_name]["highNum"] += pest_num
|
|
|
+ else:
|
|
|
+ pest_day_info[pest_name] = {"startTime":time_serialize,"highTime":time_serialize,"endTime":time_serialize,"highNum":pest_num}
|
|
|
# 最后一天的数据统计,循环内加不了
|
|
|
for pest_day_key,pest_day_value in pest_day_info.items():
|
|
|
if pest_day_key in pest_info:
|