Commit 47e0208b authored by lvshibao's avatar lvshibao

数据更新

parent cca2bbf7
import os
from inspect_report.cron import team_seat
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.config.settings")
import django
django.setup()
from datetime import datetime
from dateutil.rrule import rrule, DAILY
from src.inspect_report.models import RulesStat, SeatStat, ScoreStat
from inspect_report.models import RulesStat, SeatStat, ScoreStat
def data_update_by_date(clazz, date, seat_code_team_name):
......@@ -20,7 +13,8 @@ def data_update_by_date(clazz, date, seat_code_team_name):
count = clazz.objects.filter(create_date=create_date, agentName=agent_name).update(
task=seat_code_team_name.get(agent_name, '未找到团队'))
total_count = total_count + count
print(str(date) + ', 更新' + clazz.Meta.db_table + str(total_count) + '个')
print(str(date) + ', 已更新' + clazz._meta.db_table + str(total_count) + '个')
print(str(date) + ', 最终更新' + clazz._meta.db_table + str(total_count) + '个')
def rule_seat_score_data_update(start_date, end_date):
......
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