Commit 7005f31e authored by lvshibao's avatar lvshibao

修改定时任务时间

parent 36e70fd9
...@@ -33,7 +33,7 @@ def team_seat(): ...@@ -33,7 +33,7 @@ def team_seat():
return seat_code_team_name return seat_code_team_name
@kronos.register('30 1,8,12 * * *') @kronos.register('30 1,6,12 * * *')
def rule_stat(start_date=None, end_date=None): def rule_stat(start_date=None, end_date=None):
""" """
首页概述-违规项统计 首页概述-违规项统计
...@@ -42,7 +42,7 @@ def rule_stat(start_date=None, end_date=None): ...@@ -42,7 +42,7 @@ def rule_stat(start_date=None, end_date=None):
seat_code_team_name = team_seat() seat_code_team_name = team_seat()
if not start_date and not end_date: if not start_date and not end_date:
start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d') start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d')
end_date = datetime.now().strftime('%Y-%m-%d') end_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
logger.info('[rule_stat]rule stat start...') logger.info('[rule_stat]rule stat start...')
task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date} task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date}
tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId') tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId')
...@@ -80,7 +80,7 @@ def rule_stat(start_date=None, end_date=None): ...@@ -80,7 +80,7 @@ def rule_stat(start_date=None, end_date=None):
logger.info('[rule_stat]rule stat end.') logger.info('[rule_stat]rule stat end.')
@kronos.register('30 1,8,12 * * *') @kronos.register('30 1,6,12 * * *')
def seat_stat(start_date=None, end_date=None): def seat_stat(start_date=None, end_date=None):
""" """
首页概述-违规坐席统计 首页概述-违规坐席统计
...@@ -89,7 +89,7 @@ def seat_stat(start_date=None, end_date=None): ...@@ -89,7 +89,7 @@ def seat_stat(start_date=None, end_date=None):
seat_code_team_name = team_seat() seat_code_team_name = team_seat()
if not start_date and not end_date: if not start_date and not end_date:
start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d') start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d')
end_date = datetime.now().strftime('%Y-%m-%d') end_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
logger.info('[seat_stat]violate seat stat start...') logger.info('[seat_stat]violate seat stat start...')
task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date} task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date}
tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId') tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId')
...@@ -128,7 +128,7 @@ def seat_stat(start_date=None, end_date=None): ...@@ -128,7 +128,7 @@ def seat_stat(start_date=None, end_date=None):
logger.info('[seat_stat]violate seat stat end.') logger.info('[seat_stat]violate seat stat end.')
@kronos.register('30 1,8,12 * * *') @kronos.register('30 1,6,12 * * *')
def score_stat(start_date=None, end_date=None): def score_stat(start_date=None, end_date=None):
""" """
坐席得分统计 坐席得分统计
...@@ -137,7 +137,7 @@ def score_stat(start_date=None, end_date=None): ...@@ -137,7 +137,7 @@ def score_stat(start_date=None, end_date=None):
seat_code_team_name = team_seat() seat_code_team_name = team_seat()
if not start_date and not end_date: if not start_date and not end_date:
start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d') start_date = (datetime.now() + timedelta(days=-1)).strftime('%Y-%m-%d')
end_date = datetime.now().strftime('%Y-%m-%d') end_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
logger.info('[score_stat]seat score stat start...') logger.info('[score_stat]seat score stat start...')
task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date} task_condition = {'hasCheck': 1, 'createdAt__gte': start_date, 'createdAt__lt': end_date}
tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId') tasks = Tasks.objects.filter(**task_condition).values('id', 'name', 'sessionCollectionId')
......
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