From 1606213cbc94ab5966686ca2ec3a9c3b7c29e2bd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 23 Mar 2023 11:15:12 +0800 Subject: [PATCH] =?UTF-8?q?refector:=20=E6=89=93=E5=8D=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/hrm/views.py b/apps/hrm/views.py index 72e59b40..358f8c61 100755 --- a/apps/hrm/views.py +++ b/apps/hrm/views.py @@ -30,7 +30,8 @@ from rest_framework.permissions import IsAuthenticated epTypeOptions = {'employee': '正式员工', 'remployee': '相关方', 'visitor': '访客', 'driver': '货车司机'} -crOptions = {10: '上班打卡', 20: '下班打卡'} +crOptions = {10: '上班打卡', 20: '下班打卡', 30: ''} +crEoptions = {10: '在岗时间短', 20: '在岗时间长', 30: '缺卡', 40: '加班'} # Create your views here. @@ -235,9 +236,8 @@ class ClockRecordViewSet(ListModelMixin, CustomGenericViewSet): """导出excel 导出excel """ - field_data = ['人员类型', '人员', '编号', '身份证号', - '所属部门', '打卡类型', '触发形式', '体温', '打卡时间'] - queryset = self.filter_queryset(self.get_queryset()).filter(type__in=[10, 20]) + field_data = ['人员类型', '人员', '编号', '身份证号', '所属部门', '触发形式', '打卡时间', '打卡推测', '异常推测'] + queryset = self.filter_queryset(self.get_queryset()) odata = ClockRecordListSerializer(queryset, many=True).data # 处理数据 data = [] @@ -248,10 +248,10 @@ class ClockRecordViewSet(ListModelMixin, CustomGenericViewSet): i['employee_']['number'], i['employee_']['id_number'], i['employee_'].get('belong_dept_name', ''), - crOptions[i['type']], i['detail'].get('deviceName', None), - i['detail'].get('curTemp', None), - i['create_time']] + i['create_time']], + crOptions[i['type']], + crEoptions[i['exception_type']] ) return Response({'path': export_excel(field_data, data, '打卡记录')})