220 lines
16 KiB
Markdown
220 lines
16 KiB
Markdown
|
|
# Настройка правил поиска для ЖСД
|
|||
|
|
|
|||
|
|
В данной форме настраиваются правила поиска документа для [журнала состояния документов](../../../User manuals/СЭД/analiz.md#журнал_состояния_документов).
|
|||
|
|
Чтобы открыть данную форму необходимо перейти в Меню - Администрирование - Документооборот - СЭД - Настройка правил поиска для ЖСД.
|
|||
|
|
|
|||
|
|
Для создания нового правила в панели инструментов необходимо нажать "Создать".
|
|||
|
|
|
|||
|
|
Откроется новая форма.
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
## Основные настройка
|
|||
|
|
|
|||
|
|
В этом блоке задаются основные настройки поиска документов.
|
|||
|
|
|
|||
|
|
* **Не используется** - при включенной функции данная настройка не будет отображаться в журнале состояния документов.
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
* **Пользовательское наименование** - указывается наименование настройки для отображения в журнале состояния документов.
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
* **Служебное наименование** - указывается служебное наименование по которому фильтруется реестр документов. Служебное наименование должно быть **уникальным** в системе.
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
* **Показывать в форме** - указывается служебное наименование формы, в которой необходимо отображать данную настройку, например, в личном кабинете HR. Если поле незаполнено то данная настройка отображается во всех формах.
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
* **Скрыть кол. Подразделение инициатора** - скрывает колонку "Подразделение инициатора"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Плановая дата обработки** - скрывает колонку "Плановая дата обработки"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Просрочено** - скрывает колонку "Просрочено"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Задача** - скрывает колонку "Задача"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Факт дата обработки** - скрывает колонку "Фактическая дата обработки"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Инициатор** - скрывает колонку "Инициатор"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Дата поступления** - скрывает колонку "Дата поступления"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Решение** - скрывает колонку "Решение"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Участник** - скрывает колонку "Участник"
|
|||
|
|
|
|||
|
|
* **Скрыть кол. Комментарии** - скрывает колонку "Комментарии"
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## Дополнительные колонки
|
|||
|
|
|
|||
|
|
В данном блоке можно добавить дополнительные колонки для отображения в журнале. Наименование колонок может быть произвольным. Информация в дополнительных колонках отображается в зависимости от указанных в [запросе](#запрос) условий. Чтобы настроить дополнительные колонки рекомендуем обратиться в [техническую поддержку](../../../User manuals/Кадровый ЭДО/Заявка в техподдержку от пользователя/Заявка в техподдержку от пользователя.md).
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
## Запрос
|
|||
|
|
|
|||
|
|
В данном блоке указывается часть с динамическим запросом, содержащим непосредственно запроса для отображения документов.
|
|||
|
|
|
|||
|
|
Примеры запросов:
|
|||
|
|
|
|||
|
|
**Просроченные документы** - в реестре отображаются документы, по которым были нарушены сроки обработки:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "DocTypeName" , "SettingsId"
|
|||
|
|
, "orgId" , "DocumentDate" , "DocumentNumber" , "VirtualCUser" , "DateOfExecution"
|
|||
|
|
, "DateControl" , "RouteVCode" , "RouteStatusId" , "RouteStatusName" , "DocName"
|
|||
|
|
, "DocSubject" , "expired" , "StageNumber" , "BeginDate" , "ActionDate"
|
|||
|
|
, "DocumentAction" , "DocumentStatus" , "FromMessage" , "eDate", "Department"
|
|||
|
|
, "StageUser" , "StageItemStatus" , "StageStatus" , "StageItemAction" , "DocumentSubtype" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC" , "AnyColumnD" , "AnyColumnE")
|
|||
|
|
select dd."DocCode" , dd."DocType" , dd."DocForm" , dd."DocTypeName" , dd."SettingsId"
|
|||
|
|
, dd."orgId" , dd."DocumentDate" , dd."DocumentNumber" , dd."VirtualCUser" , dd."DateOfExecution"
|
|||
|
|
, dd."DateControl" , dd."RouteVCode" , dd."RouteStatusId" , dd."RouteStatusName" , dd."DocName"
|
|||
|
|
, dd."DocSubject" , dd."expired",
|
|||
|
|
dd."StageNumber" , dd."BeginDate" , dd."ActionDate"
|
|||
|
|
, dd."DocumentAction" , dd."DocumentStatus" , dd."FromMessage" , dd."eDate", dd."Department"
|
|||
|
|
, dd."StageUser" , dd."StageItemStatus" , dd."StageStatus" , dd."StageItemAction", dd."DocumentSubtype", dd."AnyColumnA" , dd."AnyColumnB" , dd."AnyColumnC" , dd."AnyColumnD" , dd."AnyColumnE"
|
|||
|
|
from (
|
|||
|
|
select t."DocCode" , t."DocType" , t."DocForm" , t."DocTypeName" , t."SettingsId"
|
|||
|
|
, t."orgId" , t."DocumentDate" , t."DocumentNumber" , t."VirtualCUser" , t."DateOfExecution"
|
|||
|
|
, t."DateControl" , t."RouteVCode" , t."RouteStatusId" , t."RouteStatusName" , t."DocName"
|
|||
|
|
, t."DocSubject" ,
|
|||
|
|
comdoc."dfwcGetDuration"(t."eDate", COALESCE(t."ActionDate", _now), false, t."orgId", null, _dayoff1, _dayoff2, null) as "expired",
|
|||
|
|
t."StageNumber" , t."BeginDate" , t."ActionDate"
|
|||
|
|
, t."DocumentAction" , t."DocumentStatus" , t."FromMessage" , t."eDate", t."Department"
|
|||
|
|
, t."StageUser" , t."StageItemStatus" , t."StageStatus" , t."StageItemAction", t."DocumentSubtype", t."AnyColumnA" , t."AnyColumnB" , t."AnyColumnC" , t."AnyColumnD" , t."AnyColumnE"
|
|||
|
|
from "tmp_preresult" t
|
|||
|
|
where coalesce(t."RouteStatusId",0) = 2 and t."IsMarked" is not true
|
|||
|
|
and t."StageItemStatus"= 2
|
|||
|
|
AND (
|
|||
|
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
|||
|
|
) ) dd
|
|||
|
|
where
|
|||
|
|
coalesce(dd."expired", 0) <> 0 ;
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Зависшие документы у инициатора** - в реестре отображаются документы, которые были инициированы сотрудником, но не запущены далее по маршруту согласования.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "DocTypeName" , "SettingsId"
|
|||
|
|
, "orgId" , "DocumentDate" , "DocumentNumber" , "VirtualCUser" , "DateOfExecution"
|
|||
|
|
, "DateControl" , "RouteVCode" , "RouteStatusId" , "RouteStatusName" , "DocName"
|
|||
|
|
, "DocSubject" , "expired" , "StageNumber" , "BeginDate" , "ActionDate"
|
|||
|
|
, "DocumentAction" , "DocumentStatus" , "FromMessage" , "eDate", "Department"
|
|||
|
|
, "StageUser" , "StageItemStatus" , "StageStatus" , "StageItemAction" , "DocumentSubtype", "AnyColumnA" , "AnyColumnB" , "AnyColumnC" , "AnyColumnD" , "AnyColumnE")
|
|||
|
|
select t."DocCode" , t."DocType" , t."DocForm" , t."DocTypeName" , t."SettingsId"
|
|||
|
|
, t."orgId" , t."DocumentDate" , t."DocumentNumber" , t."VirtualCUser" , t."DateOfExecution"
|
|||
|
|
, t."DateControl" , t."RouteVCode" , t."RouteStatusId" , t."RouteStatusName" , t."DocName"
|
|||
|
|
, t."DocSubject" ,
|
|||
|
|
comdoc."dfwcGetDuration"(t."eDate", COALESCE(t."ActionDate", _now), false, t."orgId", 1, _dayoff1, _dayoff2, null) ,
|
|||
|
|
t."StageNumber" , t."BeginDate" , t."ActionDate"
|
|||
|
|
, t."DocumentAction" , t."DocumentStatus" , t."FromMessage" , t."eDate", t."Department"
|
|||
|
|
, t."StageUser" , t."StageItemStatus" , t."StageStatus" , t."StageItemAction", t."DocumentSubtype" , t."AnyColumnA" , t."AnyColumnB" , t."AnyColumnC" , t."AnyColumnD" , t."AnyColumnE"
|
|||
|
|
from "tmp_preresult" t
|
|||
|
|
where coalesce(t."RouteStatusId",0) in ( 2 ) and t."StageItemStatus"= 2 and t."IsMarked" is not true
|
|||
|
|
and t."StageNumber" = 1 AND (
|
|||
|
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
|||
|
|
) ;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Поступят к hr в ближайшее время** - в реестре отображаются документы, которые в данный момент находятся на стадии согласования у руководителя сотрудника, и после этого поступят в HR службу.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "DocTypeName" , "SettingsId"
|
|||
|
|
, "orgId" , "DocumentDate" , "DocumentNumber" , "VirtualCUser" , "DateOfExecution"
|
|||
|
|
, "DateControl" , "RouteVCode" , "RouteStatusId" , "RouteStatusName" , "DocName"
|
|||
|
|
, "DocSubject" , "expired" , "StageNumber" , "BeginDate" , "ActionDate"
|
|||
|
|
, "DocumentAction" , "DocumentStatus" , "FromMessage" , "eDate", "Department"
|
|||
|
|
, "StageUser" , "StageItemStatus" , "StageStatus" , "StageItemAction" , "DocumentSubtype" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC" , "AnyColumnD" , "AnyColumnE")
|
|||
|
|
select t."DocCode" , t."DocType" , t."DocForm" , t."DocTypeName" , t."SettingsId"
|
|||
|
|
, t."orgId" , t."DocumentDate" , t."DocumentNumber" , t."VirtualCUser" , t."DateOfExecution"
|
|||
|
|
, t."DateControl" , t."RouteVCode" , t."RouteStatusId" , t."RouteStatusName" , t."DocName"
|
|||
|
|
, t."DocSubject" ,
|
|||
|
|
comdoc."dfwcGetDuration"(t."eDate", COALESCE(t."ActionDate", _now), false, t."orgId", 1, _dayoff1, _dayoff2, null) ,
|
|||
|
|
t."StageNumber" , t."BeginDate" , t."ActionDate"
|
|||
|
|
, t."DocumentAction" , t."DocumentStatus" , t."FromMessage" , t."eDate", t."Department"
|
|||
|
|
, t."StageUser" , t."StageItemStatus" , t."StageStatus" , t."StageItemAction", t."DocumentSubtype", t."AnyColumnA" , t."AnyColumnB" , t."AnyColumnC" , t."AnyColumnD" , t."AnyColumnE"
|
|||
|
|
from "tmp_preresult" t
|
|||
|
|
where coalesce(t."RouteStatusId",0) = 2 and t."IsMarked" is not true
|
|||
|
|
and t."StageItemStatus"= 2
|
|||
|
|
and exists (select 1 from "tmp_userRole" where "Role" not in ( 'hr_docflow_hr', 'hr_director_hr')
|
|||
|
|
and coalesce(t."StageUser",'') = coalesce("DocflowUser",'') )
|
|||
|
|
and exists (select 1 from comdoc."RouteStage" rs
|
|||
|
|
join comdoc."StageItem" si on rs."VCode" = si."PCode"
|
|||
|
|
where rs."PCode" = t."RouteVCode"
|
|||
|
|
and si."StageItemStatus" = 1
|
|||
|
|
and rs."IsMarked" is not true
|
|||
|
|
and si."StageUser" in (select "DocflowUser" from "tmp_userRole" where "Role" = 'hr_docflow_hr' ))
|
|||
|
|
AND (
|
|||
|
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
|||
|
|
) ;
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Сейчас в работе у hr** - в реестре отображаются документы, которые в данный момент находятся в HR службе в работе
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "DocTypeName" , "SettingsId"
|
|||
|
|
, "orgId" , "DocumentDate" , "DocumentNumber" , "VirtualCUser" , "DateOfExecution"
|
|||
|
|
, "DateControl" , "RouteVCode" , "RouteStatusId" , "RouteStatusName" , "DocName"
|
|||
|
|
, "DocSubject" , "expired" , "StageNumber" , "BeginDate" , "ActionDate"
|
|||
|
|
, "DocumentAction" , "DocumentStatus" , "FromMessage" , "eDate", "Department"
|
|||
|
|
, "StageUser" , "StageItemStatus" , "StageStatus" , "StageItemAction" , "IsMarked", "DocumentSubtype" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC" , "AnyColumnD" , "AnyColumnE")
|
|||
|
|
select t."DocCode" , t."DocType" , t."DocForm" , t."DocTypeName" , t."SettingsId"
|
|||
|
|
, t."orgId" , t."DocumentDate" , t."DocumentNumber" , t."VirtualCUser" , t."DateOfExecution"
|
|||
|
|
, t."DateControl" , t."RouteVCode" , t."RouteStatusId" , t."RouteStatusName" , t."DocName"
|
|||
|
|
, t."DocSubject" , comdoc."dfwcGetDuration"(
|
|||
|
|
t."eDate", COALESCE(t."ActionDate", _now), false, t."orgId", 1, _dayoff1, _dayoff2, null
|
|||
|
|
)
|
|||
|
|
, t."StageNumber" , t."BeginDate" , t."ActionDate"
|
|||
|
|
, t."DocumentAction" , t."DocumentStatus" , t."FromMessage" , t."eDate", t."Department"
|
|||
|
|
, t."StageUser" , t."StageItemStatus" , t."StageStatus" , t."StageItemAction", t."IsMarked", t."DocumentSubtype" , t."AnyColumnA" , t."AnyColumnB" , t."AnyColumnC" , t."AnyColumnD" , t."AnyColumnE"
|
|||
|
|
from "tmp_preresult" t
|
|||
|
|
where coalesce(t."RouteStatusId",0) = 2 and t."StageItemStatus"= 2
|
|||
|
|
and coalesce(t."StageUser",'') in (select coalesce("DocflowUser",'') from "tmp_userRole" where "Role" = 'hr_docflow_hr')
|
|||
|
|
AND (
|
|||
|
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
|||
|
|
) ;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Обработано службой HR сегодня** - в реестре отображаются документы, которые были обработаны сегодня службой HR сегодня.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "DocTypeName" , "SettingsId"
|
|||
|
|
, "orgId" , "DocumentDate" , "DocumentNumber" , "VirtualCUser" , "DateOfExecution"
|
|||
|
|
, "DateControl" , "RouteVCode" , "RouteStatusId" , "RouteStatusName" , "DocName"
|
|||
|
|
, "DocSubject" , "expired" , "StageNumber" , "BeginDate" , "ActionDate"
|
|||
|
|
, "DocumentAction" , "DocumentStatus" , "FromMessage" , "eDate", "Department"
|
|||
|
|
, "StageUser" , "StageItemStatus" , "StageStatus" , "StageItemAction", "DocumentSubtype" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC" , "AnyColumnD" , "AnyColumnE" )
|
|||
|
|
select t."DocCode" , t."DocType" , t."DocForm" , t."DocTypeName" , t."SettingsId"
|
|||
|
|
, t."orgId" , t."DocumentDate" , t."DocumentNumber" , t."VirtualCUser" , t."DateOfExecution"
|
|||
|
|
, t."DateControl" , t."RouteVCode" , t."RouteStatusId" , t."RouteStatusName" , t."DocName"
|
|||
|
|
, t."DocSubject" ,
|
|||
|
|
comdoc."dfwcGetDuration"(t."eDate", COALESCE(t."ActionDate", _now), false, t."orgId", 1, _dayoff1, _dayoff2, null) ,
|
|||
|
|
t."StageNumber" , t."BeginDate" , t."ActionDate"
|
|||
|
|
, t."DocumentAction" , t."DocumentStatus" , t."FromMessage" , t."eDate", t."Department"
|
|||
|
|
, t."StageUser" , t."StageItemStatus" , t."StageStatus" , t."StageItemAction", t."DocumentSubtype", t."AnyColumnA" , t."AnyColumnB" , t."AnyColumnC" , t."AnyColumnD" , t."AnyColumnE"
|
|||
|
|
from "tmp_preresult" t
|
|||
|
|
where coalesce(t."RouteStatusId",0) in ( 2,3 ) and t."StageItemStatus"= 3 and t."IsMarked" is not true
|
|||
|
|
and t."DocumentStatus" not in (19,22,23,32,33,51,99)
|
|||
|
|
and t."ActionDate"::date = now()::date
|
|||
|
|
and exists (select 1 from "tmp_userRole" where "Role" = 'hr_docflow_hr' and coalesce(t."StageUser",'') = coalesce("DocflowUser",'') )
|
|||
|
|
AND (
|
|||
|
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
|||
|
|
) ;
|
|||
|
|
```
|