> For the complete documentation index, see [llms.txt](https://docs.aamsystems.ru/passoffice/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aamsystems.ru/passoffice/passoffice-guide/admin-guide-doc/background-tasks/poisk-konfliktov.md).

# Построение отчета с конфликтами

Эта задача помогает находить и устранять дубликаты людей в системе PassOffice.

### **1. Как работает поиск конфликтов?**

1. **Запустите задачу** *«Поиск конфликтов»*.
2. Система проверяет записи на **совпадение по ключевым полям** (например, ФИО, паспортные данные).
3. Все потенциальные дубликаты попадают в раздел **«Конфликты»**.
4. Оператор вручную **проверяет и объединяет записи** .

### **2. Настройка полей для поиска дублей**

Поля, по которым ищутся конфликты, задаются **в корне системы**.

**Пример полей для сравнения:**

* Фамилия + Имя + Отчество
* Номер документа
* Категория

### **3. Ускорение работы задачи (добавление индексов)**

Если задача выполняется **медленно**, нужно **проиндексировать поля поиска** в БД.

**SQL-команда для создания индекса**

```
CREATE INDEX idx_poperson_conflict_search 
ON passofficedb.poperson (field1, field2, ...);
```

**Где:**

* `idx_poperson_conflict_search` — уникальное имя индекса (лучше добавить префикс, например, `conflict_`).
* `field1, field2, ...` — поля **в том же порядке**, в котором они указаны в настройках системы.

### **4. Как объединить дубликаты?**

1. Перейдите в раздел **«Конфликты»**.
2. Выберите **записи-дубликаты**.
3. Нажмите **«Объединить»** (система предложит выбрать основную запись).
4. Подтвердите действие — данные **склеятся**, а лишние записи удалятся.

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aamsystems.ru/passoffice/passoffice-guide/admin-guide-doc/background-tasks/poisk-konfliktov.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
