From dce49059f9a55fa7013624ca7cbe5e31148389e7 Mon Sep 17 00:00:00 2001 From: mirzakaev_tf Date: Fri, 14 Mar 2025 09:30:04 +0500 Subject: [PATCH] =?UTF-8?q?25193=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D1=8A=20=D0=B0=D1=82=D1=80=D0=B8=D0=B1=D1=83=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Admin manuals/Настройка архива/index.md | 286 +++++++++++++++++-- 1 file changed, 255 insertions(+), 31 deletions(-) diff --git a/docs/Admin manuals/Настройка архива/index.md b/docs/Admin manuals/Настройка архива/index.md index 08d7eef..aa3ce84 100644 --- a/docs/Admin manuals/Настройка архива/index.md +++ b/docs/Admin manuals/Настройка архива/index.md @@ -17,22 +17,246 @@ ![Справочники FTS](./media/CustomFTSFiltersForm.png) -Id | Name | Description ----|------|------------ -Contractor | Контрагент | -Contract | Договор | -SignatoryUser | Работник | -Project | Проект | -Initiator | Инициатор | -CUser | Создатель документа | -Curator | Куратор | -StageUser | Участник маршрута | -EmpowermentSubject | Полномочия | -Filial | Организация | -Subtype | Подтип | +| Id | Name | Description | +| ------------------ | ------------------- | ----------- | +| Contractor | Контрагент | +| Contract | Договор | +| SignatoryUser | Работник | +| Project | Проект | +| Initiator | Инициатор | +| CUser | Создатель документа | +| Curator | Куратор | +| StageUser | Участник маршрута | +| EmpowermentSubject | Полномочия | +| Filial | Организация | +| Subtype | Подтип | Существует строго определённый набор значений поля "Id", приведённый в [таблице ниже](#таблица). Соответствующее им поле "Name" заполняется произвольно. В справочнике «Итоговые выборки поисковой системы» этим значениям будут поставлены в соответствие поля в таблицах, по которым будет осуществляться поиск и фильтрация документов с вложениями. +### Примеры поисковых запросов + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ИмяЗапросПоля
Route + ```sql + SELECT t."DocCode", t."DocType" FROM comdoc."Route" AS t + ``` + DocName, DocSubject
Акты аннулирования + ```sql + SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."CancellationAct" AS t + ``` + Subject, DocTypeName, DocCode
Графики отпусков + ```sql + SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM aw."RP_DocVacation" AS t + ``` + NumDoc, NameDoc, Year, Note
Дин. атрибуты: договоры + ```sql + select t."DocCode", t."DocType" from ( SELECT d."VCode" AS "DocCode", + d."TypeName" AS "DocType", t.* FROM comdoc."DocflowExists" AS d + join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode" + join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode" + join dfd."DocumentAdditionalAttribute" AS a + ON dcat."VCode" = a."CategoryAttributeType" + and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Contract' + join contract."VContract" t on a."BigIntValue" = t."VCode" ) as t + ``` + Name
Дин. атрибуты: должность + ```sql + select t."DocCode", t."DocType" + from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* FROM comdoc."DocflowExists" AS d + join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode" + join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode" + join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType" + and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Post' + join rp."RP_Post" t on a."BigIntValue" = t."VCode" ) as t + ``` +Name
Дин. атрибуты: контрагенты +```sql +select t."DocCode", t."DocType" from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* +FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc +on d."DocumentCategory" = dc."VCode" join dfd."DocumentCategoryAttributeType" dcat +on dc."VCode" = dcat."PCode" join dfd."DocumentAdditionalAttribute" AS a +ON dcat."VCode" = a."CategoryAttributeType" and d."VCode" = a."PCode" +and dcat."AttributeType" = 'Base.Contractor' join comdoc."Contractor" t +on a."BigIntValue" = t."VCode" ) as t +``` +FullName, Name
Дин. атрибуты: подразделение +```sql +select t."DocCode", t."DocType" +from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* +FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc +on d."DocumentCategory" = dc."VCode" join dfd."DocumentCategoryAttributeType" dcat +on dc."VCode" = dcat."PCode" join dfd."DocumentAdditionalAttribute" AS a +ON dcat."VCode" = a."CategoryAttributeType" and d."VCode" = a."PCode" +and dcat."AttributeType" = 'Base.Department' join comdoc."Department" t +on a."BigIntValue" = t."VCode" ) as t +``` +FullName, Name
Дин. атрибуты: польз. тип атрибутов +```sql +select t."DocCode", t."DocType" +from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* +FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc +on d."DocumentCategory" = dc."VCode" +join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode" +join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType" +and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Unispr' +join dfd."Unispr" t on a."BigIntValue" = t."VCode" ) as t +``` +Name, AddInfo
Дин. атрибуты: простые +```sql +select t."DocCode", t."DocType" from +( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*, + comdoc."DTOC"(t."DateValue") as "DateFormatted" FROM comdoc."DocflowExists" + AS d join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode" + join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode" + join dfd."DocumentAdditionalAttribute" AS t ON dcat."VCode" = t."CategoryAttributeType" + and d."VCode" = t."PCode" and dcat."AttributeType" + in ('Date', 'bigint', 'double', 'money', 'string', 'longstring', 'DateTime', 'Time') ) as t +``` +DateFormatted, DateValue, Value, BigIntValue, DoubleValue, MoneyValue, DateTimeValue, TimeValue
Дин. атрибуты: работник +```sql +select t."DocCode", t."DocType" from +( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* +FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc +on d."DocumentCategory" = dc."VCode" +join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode" +join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType" +and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.RP_Worker' +join rp."RP_Worker" t on a."BigIntValue" = t."VCode" ) as t +``` +NameFull, NameShort
Договора +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM contract."Contract" AS t +``` +SubjectOfContract, Number, ContentContract, GoalContract, SpecialCondition, VnNumber
Заявки на выпуск +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM comdoc."ECPCertificateApplication" AS t +``` +DocumentNumber, FullName, DocflowUser
Заявки на отзыв +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM comdoc."ECPCertificateRevocation" AS t +``` +DocumentNumber, DocumentDate, FullName, Note
Заявки на планирование отпусков +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM vac."VacationRequest" AS t +``` +DocumentNumber, Note, PlanYear
КЭДО +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."UniversalDocument" AS t +``` +Text, DocumentNumber, DocumentDate
Канцелярия +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."DocflowDocument" AS t +``` +Text, Subject, DocumentNumber
Приложения +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM contract."AdditionalContract" AS t +``` +SubjectOfContract, Number
Трудовые договоры +```sql +SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM rp."RP_WorkContract" AS t +``` +NumDoc, DateDoc
+ ## Итоговые выборки поисковой системы Чтобы открыть справочник «Итоговые выборки поисковой системы», необходимо в меню в папке "Администрирование", подпапке "Документооборот", подпапке "Поисковая система" выбрать пункт «Итоговые выборки поисковой системы». @@ -225,14 +449,14 @@ and ### Настраиваемая выборка "Приложение" -| Код | Наименование | SQLScript | -|--------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Contractor | Контрагент | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)
) | -| Contract | Договор | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)
) | -| CUser | Создатель документа | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)
) | -| Initiator | Инициатор | and(
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
where an."id" = 'Initiator'
and r."Initiator" = an."value"
)) | -| StageUser | Участник маршрута | and
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
join comdoc."RouteStage" as s on s."PCode" = r."VCode"
join comdoc."StageItem" as i on i."PCode" = s."VCode"
where an."id" = 'StageUser'
and r."RouteStatus" NOT IN (4)
and i."StageUser" = an."value"
) | -| SignatoryUser | Работник | and(exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" where an."id" = 'SignatoryUser' and r."DocType" = 'EmployeeStatement' and r."Initiator" = an."value" ) or exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" join comdoc."RouteStage" as s on s."PCode" = r."VCode" join comdoc."StageItem" as i on i."PCode" = s."VCode" where an."id" = 'SignatoryUser' and r."DocType" = 'LND' AND r."RouteStatus" NOT IN(4) AND s."IsMarked" IS NOT true AND COALESCE(i."DocumentAction", 0) IN (20, 30) and i."StageUser" = an."value" ) or exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" where an."id" = 'SignatoryUser' and r."DocType" = 'LND' and r."DocflowUser" = an."value" ) or exists( select 1 from tmp_anFilters_for_documentSearch" as an join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode" JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode" JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode" where an."id" = 'SignatoryUser' and t."TypeName" = 'EmpowermentConstructor' and pc."IdTypeContact" = 6 and pc."Code" = an."value" ) )| +| Код | Наименование | SQLScript | +| ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Contractor | Контрагент | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)
) | +| Contract | Договор | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)
) | +| CUser | Создатель документа | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)
) | +| Initiator | Инициатор | and(
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
where an."id" = 'Initiator'
and r."Initiator" = an."value"
)) | +| StageUser | Участник маршрута | and
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
join comdoc."RouteStage" as s on s."PCode" = r."VCode"
join comdoc."StageItem" as i on i."PCode" = s."VCode"
where an."id" = 'StageUser'
and r."RouteStatus" NOT IN (4)
and i."StageUser" = an."value"
) | +| SignatoryUser | Работник | and(exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" where an."id" = 'SignatoryUser' and r."DocType" = 'EmployeeStatement' and r."Initiator" = an."value" ) or exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" join comdoc."RouteStage" as s on s."PCode" = r."VCode" join comdoc."StageItem" as i on i."PCode" = s."VCode" where an."id" = 'SignatoryUser' and r."DocType" = 'LND' AND r."RouteStatus" NOT IN(4) AND s."IsMarked" IS NOT true AND COALESCE(i."DocumentAction", 0) IN (20, 30) and i."StageUser" = an."value" ) or exists( select 1 from "tmp_anFilters_for_documentSearch" as an join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" where an."id" = 'SignatoryUser' and r."DocType" = 'LND' and r."DocflowUser" = an."value" ) or exists( select 1 from tmp_anFilters_for_documentSearch" as an join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode" JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode" JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode" where an."id" = 'SignatoryUser' and t."TypeName" = 'EmpowermentConstructor' and pc."IdTypeContact" = 6 and pc."Code" = an."value" ) ) | **В левую часть указывается скрипт:** @@ -268,9 +492,9 @@ WHERE t."COrg" = _orgidparam ### Настраиваемая выборка "Заявка на выпуск сертификата ЭП" -Код | Наименование | SQLScript -----|--------------|---------- -SignatoryUser | Работник | "and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'SignatoryUser' and an."value" = cast(t."DocflowUser" as character varying))" +| Код | Наименование | SQLScript | +| ------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| SignatoryUser | Работник | "and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'SignatoryUser' and an."value" = cast(t."DocflowUser" as character varying))" | **В левую часть указывается скрипт:** @@ -306,13 +530,13 @@ WHERE t."COrg" = _orgidparam ### Настраиваемая выборка "Канцелярия" -| Код | Наименование | SQLScript | -|--------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Contractor | Контрагент | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)
) | -| Contract | Договор | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)
) | -| CUser | Создатель документа | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)
) | -| Initiator | Инициатор | and(
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
where an."id" = 'Initiator'
and r."Initiator" = an."value"
)) | -| StageUser | Участник маршрута | and
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
join comdoc."RouteStage" as s on s."PCode" = r."VCode"
join comdoc."StageItem" as i on i."PCode" = s."VCode"
where an."id" = 'StageUser'
and r."RouteStatus" NOT IN (4)
and i."StageUser" = an."value"
) | +| Код | Наименование | SQLScript | +| ---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Contractor | Контрагент | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)
) | +| Contract | Договор | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)
) | +| CUser | Создатель документа | and exists(
select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)
) | +| Initiator | Инициатор | and(
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
where an."id" = 'Initiator'
and r."Initiator" = an."value"
)) | +| StageUser | Участник маршрута | and
exists(
select 1
from "tmp_anFilters_for_documentSearch" as an
join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
join comdoc."RouteStage" as s on s."PCode" = r."VCode"
join comdoc."StageItem" as i on i."PCode" = s."VCode"
where an."id" = 'StageUser'
and r."RouteStatus" NOT IN (4)
and i."StageUser" = an."value"
) | **В левую часть указывается скрипт:**