feat(turnstile): двухконтурный учет СКУД, реестры исключений с автокомплитом 1С и калибровка таймзон
This commit is contained in:
@@ -189,6 +189,19 @@ def merge_scud_and_1c(
|
||||
if reason and reason.lower() != "nan":
|
||||
absences_map[fio] = reason
|
||||
|
||||
manual_reasons_map = {}
|
||||
try:
|
||||
from services.manual_absences_repo import get_active_manual_absences_for_date
|
||||
# date_clean берется из даты контекста либо из текущих суток
|
||||
target_date_val = df_res.get('Дата', pd.Series()).iloc[0] if 'Дата' in df_res.columns and not df_res.empty else None
|
||||
if target_date_val:
|
||||
m_records = get_active_manual_absences_for_date(str(target_date_val))
|
||||
for mr in m_records:
|
||||
manual_reasons_map[mr['fio_clean']] = mr['reason']
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
df_res["detailed_reason"] = df_res["fio_clean"].map(manual_reasons_map).fillna("")
|
||||
df_res["причина отсутствия"] = df_res["fio_clean"].map(absences_map)
|
||||
df_res["Вид_отсутствия"] = df_res["причина отсутствия"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user