This commit is contained in:
pengyuthon
2025-10-11 11:22:21 +08:00
parent 45bdc9d9ac
commit fd91536354
+2 -6
View File
@@ -53,7 +53,7 @@ class BusController(Controller):
_logger.info("----------------/api/v1/record/face---------接口收到响应-------------------------------")
data = request.httprequest.json
user_id = data.get('logs')[0].get('user_id')
employee_id = request.env(user=SUPERUSER_ID)["hr.employee"].search([('user_id', '=', user_id)])
employee_id = request.env(user=SUPERUSER_ID)["hr.employee"].search([('mobile_phone', '=', user_id)])
attendance_iot_id = request.env(user=SUPERUSER_ID)["attendance.iot"].search([('name', '=', data.get('sn'))])
if employee_id:
request.env(user=SUPERUSER_ID)["hr.attendance.detail"].create({
@@ -63,11 +63,7 @@ class BusController(Controller):
'attendance_iot_id': attendance_iot_id.id, # 打卡设备
})
# now_time = fields.Datetime.to_datetime(fields.Date.today()) + timedelta(hours=8, days=1)
# start_time = now_time - timedelta(days=2)
# request.env["hr.attendance.detail"].normal_clock_in_time(employee_id, now_time, start_time)
_logger.info(f"{employee_id.name}打卡--{fields.Datetime.now()}")
_logger.info(f"考勤机自定义编码{user_id}: {employee_id.name}打卡--{fields.Datetime.now()}")
return {"Result": 0, "Msg": "添加成功"}
@route('/api/v1/user/inf_photo', methods=['POST'], type='json', auth='none', csrf=False)