Commit 71615ec5 authored by zhengjinlei's avatar zhengjinlei

更改违规项

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