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
71615ec5
Commit
71615ec5
authored
Jan 17, 2020
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改违规项
parent
a087e668
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
34 deletions
+47
-34
dataapi.py
src/inspect_report/api/dataapi.py
+15
-10
tasksapi.py
src/inspect_report/api/tasksapi.py
+10
-4
cron.py
src/inspect_report/cron.py
+4
-6
seat_check.html
src/inspect_report/templates/inspect/seat_check.html
+8
-4
seat_check.js
static/inspect/js/seat_check.js
+10
-10
No files found.
src/inspect_report/api/dataapi.py
View file @
71615ec5
...
...
@@ -10,7 +10,6 @@ from config.config import TABLE_PRE
from
django.http
import
HttpResponse
import
logging
from
pypinyin
import
Style
,
pinyin
from
django.core.paginator
import
Paginator
,
EmptyPage
,
PageNotAnInteger
import
csv
import
codecs
from
django.utils.http
import
urlquote
...
...
@@ -262,18 +261,24 @@ class DataApi(viewsets.ViewSet):
if
agent_name
:
session_condition
[
'agentName'
]
=
agent_name
checks
=
tn
.
objects
.
filter
(
**
session_condition
)
.
values
(
'id'
,
'createdAt'
,
'agentName'
,
'extra'
,
'taskId'
,
'remainTime'
,
'scoreItemRecord'
,
'sessionId'
)
'remainTime'
,
'startTime'
,
'closeTime'
,
'scoreItemRecord'
,
'sessionId'
)
for
check
in
checks
:
result
=
check
[
'scoreItemRecord'
]
t_name
=
task_name_dict
[
check
[
'taskId'
]]
total_score
=
100
extra
=
json
.
loads
(
check
[
'extra'
])
remain
=
0
if
check
[
'startTime'
]
and
check
[
'closeTime'
]:
start
=
datetime
.
strptime
(
check
[
'startTime'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
.
timestamp
()
close
=
datetime
.
strptime
(
check
[
'closeTime'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
.
timestamp
()
remain
=
int
(
close
-
start
)
f_name
=
extra
[
'filename'
]
if
extra
and
'filename'
in
extra
.
keys
()
else
''
detail
=
{
'id'
:
check
[
'id'
],
'sessionId'
:
check
[
'sessionId'
],
'createdAt'
:
check
[
'createdAt'
],
'area'
:
t_name
.
split
(
'_'
)[
0
],
'agentName'
:
check
[
'agentName'
],
'filename'
:
f_name
,
'remainTime'
:
check
[
'remainTime'
]
,
'sessionCollectionId'
:
k
,
'taskId'
:
check
[
'taskId'
]}
rule_detail
=
{
'fwyy'
:
1
0
,
'kcb'
:
10
,
'jsy'
:
5
,
'fwtd'
:
10
,
'yssb'
:
5
,
'jysb'
:
5
,
'yycl'
:
10
,
'ywcc'
:
1
5
,
'yyjlz'
:
15
,
'fwjs'
:
5
,
'wtgbj'
:
5
,
'wzyhfljs'
:
5
,
'wgzlf'
:
100
,
'mgc'
:
100
}
'remainTime'
:
remain
,
'sessionCollectionId'
:
k
,
'taskId'
:
check
[
'taskId'
]}
rule_detail
=
{
'fwyy'
:
1
5
,
'kcb'
:
5
,
'jsy'
:
3
,
'fwtd'
:
5
,
'yssb'
:
5
,
'jysb'
:
5
,
'yycl'
:
10
,
'ywcc'
:
1
0
,
'yyjlz'
:
10
,
'fwjs'
:
10
,
'wtgbj'
:
2
,
'cgjxxhs'
:
20
,
'wgzlf'
:
100
,
'mgc'
:
100
}
if
result
:
data
=
json
.
loads
(
result
)
for
d
in
data
:
...
...
@@ -303,15 +308,15 @@ class DataApi(viewsets.ViewSet):
response
.
write
(
codecs
.
BOM_UTF8
)
writer
=
csv
.
writer
(
response
)
# 设置表头
header
=
[
'时间'
,
'
坐席工号'
,
'文件名'
,
'通话时长(s)'
,
'服务用语(10
%
)'
,
'开场白(10
%
)'
,
'结束语(5
%
)'
,
'服务态度(10
%
)'
,
'语速识别(5
%
)'
,
'静音识别(5
%
)'
,
'异议处理(10
%
)'
,
'业务促成(1
5
%
)'
,
'预约及流转(15
%
)'
,
'服务介绍(5
%
)'
,
'
为提供报价(5
%
)'
,
'未做优惠费率介绍(5
%
)'
,
'违规则0分(100
%
)'
,
'敏感词(100
%
)'
,
'得分'
]
header
=
[
'时间'
,
'
地市'
,
'坐席工号'
,
'文件名'
,
'通话时长(s)'
,
'服务用语(15
%
)'
,
'开场白(5
%
)'
,
'结束语(3
%
)'
,
'服务态度(5
%
)'
,
'语速识别(5
%
)'
,
'静音识别(5
%
)'
,
'异议处理(10
%
)'
,
'业务促成(1
0
%
)'
,
'预约及流转(10
%
)'
,
'服务介绍(10
%
)'
,
'
未提供报价(2
%
)'
,
'成功件信息核实(20
%
)'
,
'违规则0分(100
%
)'
,
'敏感词(100
%
)'
,
'得分'
]
writer
.
writerow
(
header
)
# 设置表数据
for
r
in
return_data
:
row
=
[
r
[
'createdAt'
],
r
[
'agentName'
],
r
[
'filename'
],
r
[
'remainTime'
],
r
[
'fwyy'
],
r
[
'kcb'
],
r
[
'jsy'
],
row
=
[
r
[
'createdAt'
],
r
[
'a
rea'
],
r
[
'a
gentName'
],
r
[
'filename'
],
r
[
'remainTime'
],
r
[
'fwyy'
],
r
[
'kcb'
],
r
[
'jsy'
],
r
[
'fwtd'
],
r
[
'yssb'
],
r
[
'jysb'
],
r
[
'yycl'
],
r
[
'ywcc'
],
r
[
'yyjlz'
],
r
[
'fwjs'
],
r
[
'wtgbj'
],
r
[
'
wzyhflj
s'
],
r
[
'wgzlf'
],
r
[
'mgc'
],
r
[
'total_score'
]]
r
[
'
cgjxxh
s'
],
r
[
'wgzlf'
],
r
[
'mgc'
],
r
[
'total_score'
]]
writer
.
writerow
(
row
)
return
response
src/inspect_report/api/tasksapi.py
View file @
71615ec5
...
...
@@ -345,7 +345,8 @@ class TasksApi(viewsets.ViewSet):
if
agent_name
:
session_condition
[
'agentName'
]
=
agent_name
checks
=
tn
.
objects
.
filter
(
**
session_condition
)
.
values
(
'id'
,
'createdAt'
,
'agentName'
,
'extra'
,
'taskId'
,
'remainTime'
,
'scoreItemRecord'
,
'sessionId'
)
'remainTime'
,
'startTime'
,
'closeTime'
,
'scoreItemRecord'
,
'sessionId'
)
paginator
=
Paginator
(
checks
,
page_size
)
total_count
+=
paginator
.
count
try
:
...
...
@@ -360,12 +361,17 @@ class TasksApi(viewsets.ViewSet):
t_name
=
task_name_dict
[
check
[
'taskId'
]]
total_score
=
100
extra
=
json
.
loads
(
check
[
'extra'
])
remain
=
0
if
check
[
'startTime'
]
and
check
[
'closeTime'
]:
start
=
datetime
.
strptime
(
check
[
'startTime'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
.
timestamp
()
close
=
datetime
.
strptime
(
check
[
'closeTime'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
.
timestamp
()
remain
=
int
(
close
-
start
)
f_name
=
extra
[
'filename'
]
if
extra
and
'filename'
in
extra
.
keys
()
else
''
detail
=
{
'id'
:
check
[
'id'
],
'sessionId'
:
check
[
'sessionId'
],
'createdAt'
:
check
[
'createdAt'
],
'area'
:
t_name
.
split
(
'_'
)[
0
],
'agentName'
:
check
[
'agentName'
],
'filename'
:
f_name
,
'remainTime'
:
check
[
'remainTime'
]
,
'sessionCollectionId'
:
k
,
'taskId'
:
check
[
'taskId'
]}
rule_detail
=
{
'fwyy'
:
1
0
,
'kcb'
:
10
,
'jsy'
:
5
,
'fwtd'
:
10
,
'yssb'
:
5
,
'jysb'
:
5
,
'yycl'
:
10
,
'ywcc'
:
1
5
,
'yyjlz'
:
15
,
'fwjs'
:
5
,
'wtgbj'
:
5
,
'wzyhfljs'
:
5
,
'wgzlf'
:
100
,
'mgc'
:
100
}
'remainTime'
:
remain
,
'sessionCollectionId'
:
k
,
'taskId'
:
check
[
'taskId'
]}
rule_detail
=
{
'fwyy'
:
1
5
,
'kcb'
:
5
,
'jsy'
:
3
,
'fwtd'
:
5
,
'yssb'
:
5
,
'jysb'
:
5
,
'yycl'
:
10
,
'ywcc'
:
1
0
,
'yyjlz'
:
10
,
'fwjs'
:
10
,
'wtgbj'
:
2
,
'cgjxxhs'
:
20
,
'wgzlf'
:
100
,
'mgc'
:
100
}
if
result
:
data
=
json
.
loads
(
result
)
for
d
in
data
:
...
...
src/inspect_report/cron.py
View file @
71615ec5
...
...
@@ -11,10 +11,8 @@ from datetime import datetime, timedelta
"""
logger
=
logging
.
getLogger
(
'app_file'
)
score_item_zero
=
{
'违规则零分'
:
100
,
'敏感词'
:
100
}
score_item_service
=
{
'异议处理'
:
10
,
'业务促成'
:
15
,
'预约及流转'
:
15
,
'服务介绍'
:
5
,
'6_引导流程_2个场景'
:
0
,
'未提供报价'
:
5
,
'未做优惠费率介绍'
:
5
}
score_item_business
=
{
'结束语'
:
5
,
'服务态度'
:
10
,
'服务用语'
:
10
,
'语速识别'
:
5
,
'静音识别'
:
5
,
'6_2_引导流程_投诉安抚'
:
0
,
'开场白'
:
10
}
score_item_service
=
{
'服务用语'
:
15
,
'开场白'
:
5
,
'结束语'
:
3
,
'服务态度'
:
5
,
'语速识别'
:
5
,
'静音识别'
:
5
}
score_item_business
=
{
'异议处理'
:
10
,
'业务促成'
:
10
,
'预约及流转'
:
10
,
'服务介绍'
:
10
,
'未提供报价'
:
2
,
'成功件信息核实'
:
20
}
@
kronos
.
register
(
'30 1,8,12 * * *'
)
...
...
@@ -142,8 +140,8 @@ def score_stat(start_date=None, end_date=None):
for
check
in
checks
:
stat_count
+=
1
score_item
=
json
.
loads
(
check
[
'scoreItemRecord'
])
service_score
=
55
business_score
=
45
service_score
=
38
business_score
=
62
validate_zero
=
0
for
m
in
score_item
:
...
...
src/inspect_report/templates/inspect/seat_check.html
View file @
71615ec5
...
...
@@ -171,6 +171,10 @@
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"area"
label=
"地市"
width=
"60"
>
</el-table-column>
<el-table-column
prop=
"agentName"
label=
"坐席工号"
...
...
@@ -190,7 +194,7 @@
width=
"100"
>
</el-table-column>
<el-table-column
label=
"服务类(
45
%)"
label=
"服务类(
38
%)"
>
<el-table-column
prop=
"fwyy"
...
...
@@ -224,7 +228,7 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"业务类(
55
%)"
label=
"业务类(
62
%)"
>
<el-table-column
prop=
"yycl"
...
...
@@ -252,8 +256,8 @@
width=
"100"
>
</el-table-column>
<el-table-column
prop=
"
wzyhflj
s"
label=
"
未做优惠费率介绍
"
prop=
"
cgjxxh
s"
label=
"
成功件信息核实
"
width=
"140"
>
</el-table-column>
</el-table-column>
...
...
static/inspect/js/seat_check.js
View file @
71615ec5
...
...
@@ -34,23 +34,23 @@ new Vue({
yyjlz
:
'
9
'
,
fwjs
:
'
10
'
,
wtgbj
:
'
11
'
,
wzyhflj
s
:
'
12
'
,
cgjxxh
s
:
'
12
'
,
wgzlf
:
'
13
'
,
mgc
:
'
14
'
,
},
{
createdAt
:
'
质检考核权重
'
,
fwyy
:
'
1
0
%
'
,
kcb
:
'
10
%
'
,
jsy
:
'
5
%
'
,
fwtd
:
'
10
%
'
,
fwyy
:
'
1
5
%
'
,
kcb
:
'
5
%
'
,
jsy
:
'
3
%
'
,
fwtd
:
'
5
%
'
,
yssb
:
'
5%
'
,
jysb
:
'
5%
'
,
yycl
:
'
10%
'
,
ywcc
:
'
1
5
%
'
,
yyjlz
:
'
1
5
%
'
,
fwjs
:
'
5
%
'
,
wtgbj
:
'
5
%
'
,
wzyhfljs
:
'
5
%
'
,
ywcc
:
'
1
0
%
'
,
yyjlz
:
'
1
0
%
'
,
fwjs
:
'
10
%
'
,
wtgbj
:
'
2
%
'
,
cgjxxhs
:
'
20
%
'
,
wgzlf
:
'
100%
'
,
mgc
:
'
100%
'
,
}],
...
...
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