Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengjinlei
inspect_report
Commits
47e0208b
Commit
47e0208b
authored
Apr 27, 2020
by
lvshibao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据更新
parent
cca2bbf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
data_update.py
src/inspect_report/data_update.py
+3
-9
No files found.
tests
/data_update.py
→
src/inspect_report
/data_update.py
View file @
47e0208b
import
os
from
inspect_report.cron
import
team_seat
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
datetime
import
datetime
from
dateutil.rrule
import
rrule
,
DAILY
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
):
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):
...
@@ -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
(
count
=
clazz
.
objects
.
filter
(
create_date
=
create_date
,
agentName
=
agent_name
)
.
update
(
task
=
seat_code_team_name
.
get
(
agent_name
,
'未找到团队'
))
task
=
seat_code_team_name
.
get
(
agent_name
,
'未找到团队'
))
total_count
=
total_count
+
count
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
):
def
rule_seat_score_data_update
(
start_date
,
end_date
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment