|
@@ -11,8 +11,10 @@ from Model.models import FeedBackModel, StatResModel, PushInaccurateFeedback
|
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
+from Object.utils import LocalDateTimeUtil
|
|
|
from Service.CommonService import CommonService
|
|
|
from Service.ModelService import ModelService
|
|
|
+from Service.EquipmentInfoService import EquipmentInfoService
|
|
|
|
|
|
|
|
|
class FeedBackView(View):
|
|
@@ -345,6 +347,13 @@ class FeedBackView(View):
|
|
|
now_time = int(time.time())
|
|
|
is_st = int(is_st)
|
|
|
try:
|
|
|
+ # 默认查询近七天内数据
|
|
|
+ end_time = int(time.time())
|
|
|
+ start_time = LocalDateTimeUtil.get_before_days_timestamp(end_time, 7)
|
|
|
+ uid_list = uid.split(',')
|
|
|
+ equipment_info_qs, count = EquipmentInfoService. \
|
|
|
+ union_equipment_info(user_id, uid_list, event_type, start_time, end_time, 1, 10)
|
|
|
+ identify_type = 1 if equipment_info_qs[0]['event_tag'] else 0
|
|
|
s3 = AmazonS3Util(
|
|
|
aws_access_key_id=ACCESS_KEY_ID,
|
|
|
secret_access_key=SECRET_ACCESS_KEY,
|
|
@@ -365,7 +374,8 @@ class FeedBackView(View):
|
|
|
s3.copy_obj(PUSH_BUCKET, PUSH_INACCURATE_BUCKET, file_path)
|
|
|
PushInaccurateFeedback.objects.create(equipment_info_id=equipment_info_id, user_id=user_id,
|
|
|
event_type=event_type, uid=uid, channel=channel,
|
|
|
- add_time=now_time, tag=tag, is_st=is_st, event_time=event_time)
|
|
|
+ add_time=now_time, tag=tag, is_st=is_st, event_time=event_time,
|
|
|
+ identify_type=identify_type)
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|