diff --git a/dokogen/dictionaries/net_methods.json b/dokogen/dictionaries/net_methods.json index f706102..6650e45 100644 --- a/dokogen/dictionaries/net_methods.json +++ b/dokogen/dictionaries/net_methods.json @@ -1,4 +1,6 @@ [ "проводной", - "беспроводной" -] + "беспроводной", + "Проводной", + "Без проводной" +] \ No newline at end of file diff --git a/dokogen/dictionaries/object_types.json b/dokogen/dictionaries/object_types.json index 6102711..7fea437 100644 --- a/dokogen/dictionaries/object_types.json +++ b/dokogen/dictionaries/object_types.json @@ -1,5 +1,7 @@ [ "Информационная система", "Автоматизированная система управления", - "Информационно-телекоммуникационная сеть" -] + "Информационно-телекоммуникационная сеть", + "Автоматизированные системы управления", + "Информационно-телекоммуникационные сети" +] \ No newline at end of file diff --git a/dokogen/models.py b/dokogen/models.py index b53c10f..2e4a1af 100644 --- a/dokogen/models.py +++ b/dokogen/models.py @@ -154,6 +154,20 @@ class Company: ] if "employees_access" in d and not isinstance(d["employees_access"], list): d["employees_access"] = [] + # Отбрасываем плейсхолдеры из старых опросников («Формат: Фамилия Имя Отчество») и пустые строки + if "employees_access" in d and isinstance(d["employees_access"], list): + clean = [] + for e in d["employees_access"]: + if not isinstance(e, dict): + continue + fio = str(e.get("fio", "")).strip() + pos = str(e.get("position", "")).strip() + if fio.lower().startswith("формат:") or fio.lower().startswith("пример:"): + continue + if not fio and not pos: + continue + clean.append(e) + d["employees_access"] = clean if "okved_extra" in d and not isinstance(d.get("okved_extra"), list): d["okved_extra"] = [] valid = {f.name for f in cls.__dataclass_fields__.values()} diff --git a/dokogen/ui.py b/dokogen/ui.py index 6c1efa2..eedad0e 100644 --- a/dokogen/ui.py +++ b/dokogen/ui.py @@ -2479,14 +2479,17 @@ class DokoGenApp: row_frame.destroy() self._employee_entries.clear() for emp in data['employeesAccess']: + fio = str(emp.get('fio', '')).strip() + pos = str(emp.get('position', '')).strip() + if fio.lower().startswith('формат:') or fio.lower().startswith('пример:'): + continue + if not fio and not pos: + continue self.model.employees_access.append({ - 'position': emp.get('position', ''), - 'fio': emp.get('fio', ''), + 'position': pos, + 'fio': fio, }) - self._add_employee_row( - emp.get('position', ''), - emp.get('fio', ''), - ) + self._add_employee_row(pos, fio) self._update_emp_count() self.log("✅ Импорт применён")