1
This commit is contained in:
@@ -203,6 +203,7 @@ class AppletAttendance(Controller):
|
||||
}
|
||||
"""
|
||||
user_id = int(kw['user_id'])
|
||||
month = int(kw['selected_month'])
|
||||
now = datetime.now()
|
||||
calendar_leaves = request.env(user=SUPERUSER_ID)['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")])
|
||||
holidays_list = [] # 假期
|
||||
@@ -270,24 +271,32 @@ class AppletAttendance(Controller):
|
||||
# 处理当月和上月记录
|
||||
current_records = self.process_attendances(current_attendance, user_id)
|
||||
prev_records = self.process_attendances(prev_attendance, user_id)
|
||||
return_data = {
|
||||
'code': '200',
|
||||
'message': 'OK',
|
||||
'data': {
|
||||
# 本月打卡
|
||||
'current_month': {
|
||||
'holiday_data': holiday_data,
|
||||
'banner_rote': current_stats,
|
||||
'attendance_data': current_records,
|
||||
},
|
||||
# 上月打卡
|
||||
'previous_month': {
|
||||
'holiday_data': holiday_data,
|
||||
'banner_rote': prev_stats,
|
||||
'attendance_data': prev_records,
|
||||
if month[-2:-1] == fields.Date.today().month:
|
||||
return_data = {
|
||||
'code': '200',
|
||||
'message': 'OK',
|
||||
'data': {
|
||||
'current_month': {
|
||||
'holiday_data': holiday_data,
|
||||
'banner_rote': current_stats,
|
||||
'attendance_data': current_records,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
elif month[-2:-1] == fields.Date.today().month - 1:
|
||||
return_data = {
|
||||
'code': '200',
|
||||
'message': 'OK',
|
||||
'data': {
|
||||
'current_month': {
|
||||
'holiday_data': holiday_data,
|
||||
'banner_rote': prev_stats,
|
||||
'attendance_data': prev_records,
|
||||
}
|
||||
}
|
||||
}
|
||||
else:
|
||||
return_data = {'code': '300', 'message': '月份异常'}
|
||||
return json.dumps(return_data)
|
||||
|
||||
# 处理考勤记录
|
||||
|
||||
Reference in New Issue
Block a user