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
e5041c7c
Commit
e5041c7c
authored
Dec 19, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询列表
parent
0276654d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
tasksapi.py
src/inspect_report/api/tasksapi.py
+36
-0
No files found.
src/inspect_report/api/tasksapi.py
View file @
e5041c7c
...
@@ -565,6 +565,42 @@ class TasksApi(viewsets.ViewSet):
...
@@ -565,6 +565,42 @@ class TasksApi(viewsets.ViewSet):
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'count'
:
total_count
,
'data'
:
seats
.
object_list
})
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'count'
:
total_count
,
'data'
:
seats
.
object_list
})
@
action
([
'post'
],
detail
=
False
)
def
score_detail
(
self
,
req
:
Request
):
"""
坐席得分列表
:param req:
:return:
"""
agent_name
=
req
.
data
.
get
(
'agentName'
,
''
)
area
=
req
.
data
.
get
(
'area'
,
''
)
page
=
req
.
data
.
get
(
'page'
,
'1'
)
page_size
=
req
.
data
.
get
(
'page_size'
,
'10'
)
start_date
=
req
.
data
.
get
(
'start_date'
,
(
datetime
.
now
()
+
timedelta
(
days
=-
1
))
.
strftime
(
'
%
Y-
%
m-
%
d'
))
end_date
=
req
.
data
.
get
(
'end_date'
,
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
))
q_start_date
=
datetime
.
strptime
(
start_date
,
'
%
Y-
%
m-
%
d'
)
.
date
()
q_end_date
=
(
datetime
.
strptime
(
end_date
,
'
%
Y-
%
m-
%
d'
)
+
+
timedelta
(
days
=
1
))
.
date
()
session_condition
=
{
'create_date__gte'
:
q_start_date
,
'create_date__lt'
:
q_end_date
}
if
agent_name
:
session_condition
[
'agentName'
]
=
agent_name
if
area
:
session_condition
[
'task'
]
=
area
checks
=
RulesStat
.
objects
.
filter
(
**
session_condition
)
\
.
extra
(
select
=
{
'sessionCollectionId'
:
'sessionCollectionId'
})
\
.
values
(
'agentName'
,
'customName'
,
'remainTime'
,
'score'
,
'sessionCollectionId'
,
'sessionId'
,
'taskId'
)
\
.
distinct
()
paginator
=
Paginator
(
checks
,
page_size
)
total_count
=
paginator
.
count
try
:
seats
=
paginator
.
page
(
page
)
except
PageNotAnInteger
:
seats
=
paginator
.
page
(
1
)
except
EmptyPage
:
seats
=
paginator
.
page
(
paginator
.
num_pages
)
return
Response
({
'code'
:
0
,
'msg'
:
'success'
,
'count'
:
total_count
,
'data'
:
seats
.
object_list
})
@
xframe_options_exempt
@
xframe_options_exempt
def
rule
(
request
):
def
rule
(
request
):
...
...
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