Commit 71615ec5 authored by zhengjinlei's avatar zhengjinlei

更改违规项

parent a087e668
......@@ -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': 10, 'kcb': 10, 'jsy': 5, 'fwtd': 10, 'yssb': 5, 'jysb': 5, 'yycl': 10,
'ywcc': 15, 'yyjlz': 15, 'fwjs': 5, 'wtgbj': 5, 'wzyhfljs': 5, 'wgzlf': 100, 'mgc': 100}
'remainTime': remain, 'sessionCollectionId': k, 'taskId': check['taskId']}
rule_detail = {'fwyy': 15, 'kcb': 5, 'jsy': 3, 'fwtd': 5, 'yssb': 5, 'jysb': 5, 'yycl': 10,
'ywcc': 10, '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%)', '业务促成(15%)', '预约及流转(15%)', '服务介绍(5%)',
'为提供报价(5%)', '未做优惠费率介绍(5%)', '违规则0分(100%)', '敏感词(100%)', '得分']
header = ['时间', '地市', '坐席工号', '文件名', '通话时长(s)', '服务用语(15%)', '开场白(5%)', '结束语(3%)', '服务态度(5%)',
'语速识别(5%)', '静音识别(5%)', '异议处理(10%)', '业务促成(10%)', '预约及流转(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['area'], r['agentName'], 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['wzyhfljs'], r['wgzlf'], r['mgc'], r['total_score']]
r['cgjxxhs'], r['wgzlf'], r['mgc'], r['total_score']]
writer.writerow(row)
return response
......@@ -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': 10, 'kcb': 10, 'jsy': 5, 'fwtd': 10, 'yssb': 5, 'jysb': 5, 'yycl': 10,
'ywcc': 15, 'yyjlz': 15, 'fwjs': 5, 'wtgbj': 5, 'wzyhfljs': 5, 'wgzlf': 100, 'mgc': 100}
'remainTime': remain, 'sessionCollectionId': k, 'taskId': check['taskId']}
rule_detail = {'fwyy': 15, 'kcb': 5, 'jsy': 3, 'fwtd': 5, 'yssb': 5, 'jysb': 5, 'yycl': 10,
'ywcc': 10, 'yyjlz': 10, 'fwjs': 10, 'wtgbj': 2, 'cgjxxhs': 20, 'wgzlf': 100, 'mgc': 100}
if result:
data = json.loads(result)
for d in data:
......
......@@ -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:
......
......@@ -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="wzyhfljs"
label="未做优惠费率介绍"
prop="cgjxxhs"
label="成功件信息核实"
width="140">
</el-table-column>
</el-table-column>
......
......@@ -34,23 +34,23 @@ new Vue({
yyjlz:'9',
fwjs:'10',
wtgbj:'11',
wzyhfljs:'12',
cgjxxhs:'12',
wgzlf:'13',
mgc:'14',
}, {
createdAt: '质检考核权重',
fwyy:'10%',
kcb:'10%',
jsy:'5%',
fwtd:'10%',
fwyy:'15%',
kcb:'5%',
jsy:'3%',
fwtd:'5%',
yssb:'5%',
jysb:'5%',
yycl:'10%',
ywcc:'15%',
yyjlz:'15%',
fwjs:'5%',
wtgbj:'5%',
wzyhfljs:'5%',
ywcc:'10%',
yyjlz:'10%',
fwjs:'10%',
wtgbj:'2%',
cgjxxhs:'20%',
wgzlf:'100%',
mgc:'100%',
}],
......
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