From af23c08443cbd4c1b8f9d2a1c9a99e164bba75b4 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Sun, 8 Feb 2026 22:58:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- preview_easy/controllers/preview.py | 12 ++++++------ .../controllers/applet_attendance.py | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/preview_easy/controllers/preview.py b/preview_easy/controllers/preview.py index d3a571839..7a7c262bd 100644 --- a/preview_easy/controllers/preview.py +++ b/preview_easy/controllers/preview.py @@ -29,12 +29,12 @@ class preview(http.Controller): if attach.mimetype in image or attach.mimetype in video or attach.mimetype in pdf or attach.mimetype in html or attach.mimetype in txt: headers = [('Content-Type', attach.mimetype)] return werkzeug.wrappers.Response(attach.raw, status=200, headers=headers) - elif attach.mimetype in word: - with io.BytesIO(attach.raw) as file: - result = mammoth.convert_to_html(file) - html = result.value - return template.render(html=html) - elif attach.mimetype in excel: + # elif attach.mimetype in word: + # with io.BytesIO(attach.raw) as file: + # result = mammoth.convert_to_html(file) + # html = result.value + # return template.render(html=html) + elif attach.mimetype in excel or word: # 'http://view.officeapps.live.com/op/view.aspx?src=https://oa.thtzjt.com/web/content/office_preview/' office_view_url = 'http://view.officeapps.live.com/op/view.aspx?src=' base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url') diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 733cb0b8d..5cff599c2 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -192,7 +192,8 @@ class AppletAttendance(Controller): wifi_name_list = [] for wifi_mac in address_ids: for mac in wifi_mac.wifi_name_ids: - wifi_name_list.append(mac.mac) + if mac.name not in wifi_name_list: + wifi_name_list.append(mac.name) # for address_id in address_ids: # if '天成大厦' in self_address['formatted_address']: # message = '可以打卡' @@ -202,9 +203,9 @@ class AppletAttendance(Controller): # card_rice = address_id.card_rice * 0.001 # 打卡范围 # if self.is_within_radius_geopy(kw['att_latitude'], kw['att_longitude'], address_id.latitude, address_id.longitude, card_rice) or kw['wifi_name'] in wifi_name_list: wifi = kw['wifi_name'] - _logger.info(f'{wifi}-------------') - _logger.info(f'{wifi}-------------') - _logger.info(f'{wifi}-------------') + # _logger.info(f'{wifi}-------------') + # _logger.info(f'{wifi}-------------') + # _logger.info(f'{wifi}-------------') if kw['wifi_name'] in wifi_name_list: message = '可以打卡' state = 'yes'