考勤接口
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user