From 86a3739a45d0e5cd8a54ccb811f435bbaebab9ac Mon Sep 17 00:00:00 2001 From: mirzakaev_tf Date: Mon, 17 Apr 2023 11:09:16 +0500 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D0=B4=20=D1=81=D0=BA=D1=80=D0=B8?= =?UTF-8?q?=D0=BF=D1=82=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D0=B2=20=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D0=B8=D0=BA=D0=B5=20=D1=83=D0=B2=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Настройка внутрисистемных уведомлений.md | 105 ++++++++---------- 1 file changed, 47 insertions(+), 58 deletions(-) diff --git a/docs/Admin manuals/СЭД/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md b/docs/Admin manuals/СЭД/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md index 4b5f6dd..d059a9e 100644 --- a/docs/Admin manuals/СЭД/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md +++ b/docs/Admin manuals/СЭД/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md @@ -50,73 +50,62 @@ Пример: ``` -iinsert into "#forInsNotification" ("DocflowUser", "txt", "Link", "DocType", "DocName", "DocSubject", "IdWorker", "DateBeg", "Days", "TypeVacation", "Vacation", "DateEnd", "CopyTo") -select pc_ch."Code" as "User", '

' || p_ch."Name" || ' ' || coalesce(p_ch."Father", '') || ', добрый день!


- -

       На основании -статьи 123 Трудового кодекса Российской Федерации и согласно утвержденному графику отпусков на ' || p."Year"::text ||' год информируем о дате начала Вашего оплачиваемого отпуска (' || coalesce(tw."Name",ex.name1c,'')||') с ' || to_char(coalesce(m."DateBegPer",m."DateBeg")::date, 'DD.MM.YYYY') || ' сроком на ' || coalesce(m."DaysPer",m."Days")::text -|| ' календарных -дня(ей). Дата выхода на работу ' ||to_char((coalesce(m."DateEndPer",m."DateEnd") + '1 day'::interval)::date, 'DD.MM.YYYY') -|| '. В случае, если дата выхода на -работу приходится на выходной день, она переносится на ближайший рабочий день.

- -

 

- -

       ВАЖНО!

- -

В связи с -вышеизложенным Вам следует подать заявление о предоставлении отпуска для -своевременного проведения расчетов и подготовки соответствующих документов.

- -

Если Вы не -планируете использовать отпуск в указанные даты, обязательно сформируйте -заявление о переносе отпуска.

- -

 

- -

       Заявление на -отпуск или перенос отпуска необходимо сформировать в системе КЭДО Lexema по -соответствующей операции через кнопку «Операции» на панели инструментов данного -уведомления.

- -

 

- -

       Уведомление -можно закрыть только после выполнения одного из действий.

- -


-Приятного отдыха!

-' as txt, -p."VCode" as "link",p."TypeName", -null /*case when "TypeName" = 'Base.RP_DocVacationChanges' then 'Переносы отпусков' else 'График отпусков' end*/, +insert into "#forInsNotification" ("DocflowUser", "txt", "Link", "DocType", "DocName", "DocSubject", "IdWorker", "DateBeg", "Days", "TypeVacation", "Vacation", "DateEnd", "CopyTo", "txtSMS", "txtTelegram") +select pc_ch."Code" as "User", null as "txt", +p."VCode" as "link",p."TypeName", null /*case when "TypeName" = 'Base.RP_DocVacationChanges' then 'Переносы отпусков' else 'График отпусков' end*/, null, /*'Уведомление работника о времени начала отпуска',*/ - m."IdWorker", -coalesce(m."DateBegPer",m."DateBeg")::date as "DateBeg", coalesce(m."DaysPer",m."Days") as "Days", -m."HolidayTypeGuid", coalesce(tw."Name",ex.name1c), coalesce(m."DateEndPer",m."DateEnd") as "DateEnd", null as "CopyTo" +m."IdWorker", coalesce(m."DateBegPer",m."DateBeg")::date, coalesce(m."DaysPer",m."Days"), m."HolidayTypeGuid", coalesce(tw."Name",ex.name1c), coalesce(m."DateEndPer",m."DateEnd") , null, null as "txtSMS", null as "txtTelegram" from aw."RP_DocVacation" p join aw."RP_WorkerVacation" m on p."VCode" = m."Pcode" - cross join (select (now() + '1 day'::interval)::date as bd, (now() + '6 day'::interval)::date as ed ) dt + cross join (select (now() + '8 day'::interval)::date as bd, (now() + '8 day'::interval)::date as ed ) dt cross join (select "LocationProtocol" || '//' || "LocationHostName" as "link_txt" from comdoc."DocflowSettings") l join rp."RP_Worker" w_ch on w_ch."VCode" = m."IdWorker" join rp."RP_Person" p_ch on w_ch."IdPerson" = p_ch."VCode" join rp."RP_PersonContact" pc_ch on p_ch."VCode" = pc_ch."Pcode" and pc_ch."IdTypeContact" = 6 left join odata.exchange1cguids ex on m."HolidayTypeGuid" = ex.guid and ex.atype = 'TypeVacation' and ex.corg= p."COrg" left join aw."VTypeTimeWork" tw on m."TypeVacation" = tw."VCode" -where coalesce(m."DateBegPer",m."DateBeg")>= dt.bd and coalesce(m."DateBegPer",m."DateBeg") <=dt.ed and - not exists (select 1 - from "dfd"."UniversalDocument" AS "ud" - join comdoc."ReadListItem" "rl" on "ud"."VCode" = "rl"."DocCode" - join comdoc."DocflowLink" "dl" on "dl"."DocCode2" = p."VCode" and "dl"."DocCode1" = "ud"."VCode" - where "rl"."DocflowUser" = pc_ch."Code" and - "ud"."TypeName" = 'NotificationLexema' and - "ud"."Text" like '%'|| to_char(coalesce(m."DateBegPer",m."DateBeg")::date, 'DD.MM.YYYY') ||'%') - and 1 = coalesce((select "IdTypeBusy" - from rp."RP_WorkerMove" rpwm - where rpwm."IdWorker" = w_ch."VCode" - and (rpwm."DateEnd" is null - OR (now()::date <= coalesce(rpwm."DateEnd", '2100-01-01'::date))) - limit 1) - , 1) +where p."COrg" <> 4 and + coalesce(m."DateBegPer",m."DateBeg")>= dt.bd and coalesce(m."DateBegPer",m."DateBeg") <=dt.ed and + not exists (select 1 + from "dfd"."UniversalDocument" AS "ud" + join comdoc."ReadListItem" "rl" on "ud"."VCode" = "rl"."DocCode" + join comdoc."DocflowLink" "dl" on "dl"."DocCode2" = p."VCode" and "dl"."DocCode1" = "ud"."VCode" + join dfd."DocumentAdditionalAttribute" atr on "ud"."VCode" = atr."PCode" + join dfd."DocumentCategoryAttributeType" atrtype on "atr"."CategoryAttributeType" = atrtype."VCode" and "ud"."DocumentCategory" = atrtype."PCode" and atrtype."AttributeType" = 'Date' and atrtype."ColumnName" = '#bdate#' + where "rl"."DocflowUser" = pc_ch."Code" and + "ud"."TypeName" = 'NotificationLexema' and + atr."DateValue" = coalesce(m."DateBegPer",m."DateBeg") + --"ud"."Text" like '%'|| to_char(coalesce(m."DateBegPer",m."DateBeg")::date, 'DD.MM.YYYY') ||'%' + ) and + w_ch."DateEDM" is not null and + w_ch."DateEnd" is null and +--проверка на созданное заявление с завершенным маршрутом, на отпуск или на перенос + not exists (select 1 + from "dfd"."UniversalDocument" AS "ud" + join dfd."DocumentAdditionalAttribute" atr on "ud"."VCode" = atr."PCode" + join dfd."DocumentCategoryAttributeType" atrtype on "atr"."CategoryAttributeType" = atrtype."VCode" and "ud"."DocumentCategory" = atrtype."PCode" and atrtype."AttributeType" = 'Date' and atrtype."ColumnName" = '#bdate#' + join dfd."DocumentConstructor" dc on "ud"."DocumentCategory" = dc."VCode" + join dfd."DocumentSubtype" ds on dc."DocumentSubtype" = ds."VCode" + join comdoc."Route" r on ud."VCode" = r."DocCode" and ud."TypeName" = r."DocType" and r."RouteStatus" = 3 + where "ud"."TypeName" = 'EmployeeStatement' and + "ud"."IdWorker" = m."IdWorker" and + atr."DateValue" = coalesce(m."DateBegPer",m."DateBeg") and + ds."InternalName" in ('EmployeeStatementVacation','EmployeeStatementTransperVacation') and + ud."Removed" is not true and + not exists (select 1 from dfd."CancellationAct" a where a."DocCode" = ud."VCode" and a."DocType" = ud."TypeName") and +not exists (select 1 +from comdoc."Route" r + join comdoc."RouteStage" rs on r."VCode" = rs."PCode" + join comdoc."StageItem" si on rs."VCode" = si."PCode" + inner join comdoc."DocflowDocumentSettings" as sts on sts."DocType" = r."DocType" + inner join comdoc."DocflowDocumentSettingsDetail" as dfs on dfs."PCode" = sts."VCode" and + dfs."DocumentAction" = si."DocumentAction" and + dfs."DocumentStatus" = si."DocumentStatus" +where r."DocCode" = "ud"."VCode" and + r."DocType" = p."TypeName" and + dfs."NegativeStatus" is true) + ) + ``` Таблица **"#forInsNotification"** представляет собой список логинов и текстов сообщений: