change input script in border_crossing

This commit is contained in:
Fusionshh 2025-10-23 17:51:02 +03:00
parent 193a38cc97
commit c197189cb6
6 changed files with 123 additions and 299 deletions

View file

@ -33,8 +33,8 @@
<fontname>Segoe UI</fontname> <fontname>Segoe UI</fontname>
<fontsize>9</fontsize> <fontsize>9</fontsize>
<height>294</height> <height>294</height>
<xloc>160</xloc> <xloc>176</xloc>
<yloc>704</yloc> <yloc>576</yloc>
<note>+ <note>+
@ -92,29 +92,24 @@
<to>Update</to> <to>Update</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop>
<from>Table output</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop> <hop>
<from>Table input</from> <from>Table input</from>
<to>Identify last row in a stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Detect empty stream</to> <to>Detect empty stream</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Identify last row in a stream</from> <from>Table input</from>
<to>sort_by_recruit_id</to> <to>sort_by_recruit_id</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Table output</from> <from>Table input</from>
<to>Filter rows</to> <to>Table output</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
</order> </order>
@ -134,7 +129,7 @@
<row_threshold>0</row_threshold> <row_threshold>0</row_threshold>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1536</xloc> <xloc>1200</xloc>
<yloc>480</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
@ -170,7 +165,7 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1328</xloc> <xloc>1024</xloc>
<yloc>480</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
@ -202,8 +197,8 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1536</xloc> <xloc>1200</xloc>
<yloc>160</yloc> <yloc>192</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -248,8 +243,8 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
</partitioning> </partitioning>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>688</xloc> <xloc>496</xloc>
<yloc>160</yloc> <yloc>192</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -284,25 +279,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<send_true_to>Change job status on success</send_true_to> <send_true_to>Change job status on success</send_true_to>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1536</xloc> <xloc>1200</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream</name>
<type>DetectLastRow</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>320</yloc> <yloc>320</yloc>
</GUI> </GUI>
</transform> </transform>
@ -310,7 +287,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<name>Table input</name> <name>Table input</name>
<type>TableInput</type> <type>TableInput</type>
<description/> <description/>
<distribute>Y</distribute> <distribute>N</distribute>
<custom_distribution/> <custom_distribution/>
<copies>1</copies> <copies>1</copies>
<partitioning> <partitioning>
@ -320,34 +297,19 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<connection>ervu-dashboard</connection> <connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row> <execute_each_row>N</execute_each_row>
<limit/> <limit/>
<sql>SELECT <sql>WITH filteredData AS (SELECT ri.recruit_id,
ri.recruit_id, ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
CASE ctid
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date FROM ervu_dashboard.recruits_info ri
ELSE NULL WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
END as date_crossing, AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
CASE )
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
ELSE NULL to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
END as return_date, true as border_crossed,
true as border_crossed fd.ctid = (select max(ctid) from filteredData) as last_row
FROM ervu_dashboard.recruits_info ri FROM filteredData fd
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
AND '${IDM_ID}' != '' -- Проверка на пустую строку
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
--AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT elem
FROM jsonb_array_elements(
CASE
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
ELSE '[]'::jsonb
END
) as elem
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
) AS filtered_elems ON true</sql>
<variables_active>Y</variables_active> <variables_active>Y</variables_active>
<attributes/> <attributes/>
<GUI> <GUI>
@ -397,7 +359,7 @@ JOIN LATERAL (
<use_batch>Y</use_batch> <use_batch>Y</use_batch>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>976</xloc> <xloc>784</xloc>
<yloc>320</yloc> <yloc>320</yloc>
</GUI> </GUI>
</transform> </transform>
@ -432,7 +394,7 @@ JOIN LATERAL (
<use_batch>Y</use_batch> <use_batch>Y</use_batch>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>976</xloc> <xloc>784</xloc>
<yloc>480</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
@ -466,7 +428,7 @@ JOIN LATERAL (
</fields> </fields>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>688</xloc> <xloc>496</xloc>
<yloc>480</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>

View file

@ -18,32 +18,6 @@
<modified_date>2025/08/11 13:22:56.048</modified_date> <modified_date>2025/08/11 13:22:56.048</modified_date>
</info> </info>
<notepads> <notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>120</height>
<xloc>288</xloc>
<yloc>640</yloc>
<note>+
1. Перенести решение проблем описанных в ревью по первичному flow.
2. Как планируется не дублировать данные по рекруту(допустим на первичке были скопированы 2 даты, мы обновли запись и добавили еще пересечение) в новом запуске мы заного добавим 2 новые даты, + задублируем уже добавленные?
3. Insert/update нет error_description для error_handling
4. Update нет error_description для error_handling
</note>
<width>1349</width>
</notepad>
</notepads> </notepads>
<order> <order>
<hop> <hop>
@ -82,28 +56,23 @@
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Table input</from> <from>Insert / update</from>
<to>Identify last row in a stream</to> <to>Filter rows</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Identify last row in a stream</from> <from>Table input</from>
<to>sort_by_recruit_id</to> <to>sort_by_recruit_id</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Identify last row in a stream</from> <from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Detect empty stream</to> <to>Detect empty stream</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Insert / update</from> <from>Table input</from>
<to>Filter rows</to> <to>Insert / update</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
</order> </order>
@ -123,8 +92,8 @@
<row_threshold>0</row_threshold> <row_threshold>0</row_threshold>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1520</xloc> <xloc>1328</xloc>
<yloc>544</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -159,8 +128,8 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1248</xloc> <xloc>1056</xloc>
<yloc>544</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -191,8 +160,8 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1408</xloc> <xloc>1056</xloc>
<yloc>160</yloc> <yloc>208</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -240,8 +209,8 @@ and recruitment_id = '${IDM_ID}';</sql>
</partitioning> </partitioning>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>752</xloc> <xloc>560</xloc>
<yloc>160</yloc> <yloc>208</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -276,25 +245,7 @@ and recruitment_id = '${IDM_ID}';</sql>
<send_true_to>Change job status on success</send_true_to> <send_true_to>Change job status on success</send_true_to>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1408</xloc> <xloc>1056</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream</name>
<type>DetectLastRow</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>752</xloc>
<yloc>352</yloc> <yloc>352</yloc>
</GUI> </GUI>
</transform> </transform>
@ -316,16 +267,13 @@ and recruitment_id = '${IDM_ID}';</sql>
<condition>=</condition> <condition>=</condition>
<field>recruit_id</field> <field>recruit_id</field>
<name>recruit_id</name> <name>recruit_id</name>
<name2/>
</key> </key>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>date_crossing</field> <field>date_crossing</field>
<name>date_crossing</name> <name>date_crossing</name>
</key> <name2/>
<key>
<condition>=</condition>
<field>return_date</field>
<name>return_date</name>
</key> </key>
<schema>ervu_dashboard</schema> <schema>ervu_dashboard</schema>
<table>border_crossing</table> <table>border_crossing</table>
@ -348,7 +296,7 @@ and recruitment_id = '${IDM_ID}';</sql>
<update_bypassed>N</update_bypassed> <update_bypassed>N</update_bypassed>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>960</xloc> <xloc>768</xloc>
<yloc>352</yloc> <yloc>352</yloc>
</GUI> </GUI>
</transform> </transform>
@ -356,7 +304,7 @@ and recruitment_id = '${IDM_ID}';</sql>
<name>Table input</name> <name>Table input</name>
<type>TableInput</type> <type>TableInput</type>
<description/> <description/>
<distribute>Y</distribute> <distribute>N</distribute>
<custom_distribution/> <custom_distribution/>
<copies>1</copies> <copies>1</copies>
<partitioning> <partitioning>
@ -365,35 +313,20 @@ and recruitment_id = '${IDM_ID}';</sql>
</partitioning> </partitioning>
<connection>ervu-dashboard</connection> <connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row> <execute_each_row>N</execute_each_row>
<sql>SELECT <limit/>
ri.recruit_id, <sql>WITH filteredData AS (SELECT ri.recruit_id,
CASE ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date ctid
ELSE NULL FROM ervu_dashboard.recruits_info ri
END as date_crossing, WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
CASE AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date )
ELSE NULL SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
END as return_date, to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
true as border_crossed true as border_crossed,
FROM ervu_dashboard.recruits_info ri fd.ctid = (select max(ctid) from filteredData) as last_row
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id FROM filteredData fd
AND '${IDM_ID}' != '' -- Проверка на пустую строку CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
--AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT elem
FROM jsonb_array_elements(
CASE
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
ELSE '[]'::jsonb
END
) as elem
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
) AS filtered_elems ON true</sql>
<variables_active>Y</variables_active> <variables_active>Y</variables_active>
<attributes/> <attributes/>
<GUI> <GUI>
@ -415,16 +348,13 @@ JOIN LATERAL (
<commit>10000</commit> <commit>10000</commit>
<connection>ervu-dashboard</connection> <connection>ervu-dashboard</connection>
<error_ignored>Y</error_ignored> <error_ignored>Y</error_ignored>
<ignore_flag_field/>
<lookup> <lookup>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>recruit_id</field> <field>recruit_id</field>
<name>recruit_id</name> <name>recruit_id</name>
</key> <name2/>
<key>
<condition>&lt;></condition>
<field>border_crossed</field>
<name>border_crossed</name>
</key> </key>
<schema>ervu_dashboard</schema> <schema>ervu_dashboard</schema>
<table>citizen</table> <table>citizen</table>
@ -437,8 +367,8 @@ JOIN LATERAL (
<use_batch>Y</use_batch> <use_batch>Y</use_batch>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>960</xloc> <xloc>768</xloc>
<yloc>544</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -471,8 +401,8 @@ JOIN LATERAL (
</fields> </fields>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>752</xloc> <xloc>560</xloc>
<yloc>544</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform_error_handling> <transform_error_handling>

View file

@ -33,8 +33,8 @@
<fontname>Segoe UI</fontname> <fontname>Segoe UI</fontname>
<fontsize>9</fontsize> <fontsize>9</fontsize>
<height>73</height> <height>73</height>
<xloc>176</xloc> <xloc>96</xloc>
<yloc>400</yloc> <yloc>592</yloc>
<note>+ <note>+
1.Перенести решение проблем по ревью из первичного флоу 1.Перенести решение проблем по ревью из первичного флоу
@ -79,28 +79,23 @@
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Table input</from> <from>Insert / update</from>
<to>Identify last row in a stream</to> <to>Filter rows</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Identify last row in a stream</from> <from>Table input</from>
<to>Insert / update</to> <to>Insert / update</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Identify last row in a stream</from> <from>Table input</from>
<to>sort_by_recruit_id</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Detect empty stream</to> <to>Detect empty stream</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
<hop> <hop>
<from>Insert / update</from> <from>Table input</from>
<to>Filter rows</to> <to>sort_by_recruit_id</to>
<enabled>Y</enabled> <enabled>Y</enabled>
</hop> </hop>
</order> </order>
@ -120,8 +115,8 @@
<row_threshold>0</row_threshold> <row_threshold>0</row_threshold>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1408</xloc> <xloc>1136</xloc>
<yloc>416</yloc> <yloc>336</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -156,8 +151,8 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1184</xloc> <xloc>944</xloc>
<yloc>416</yloc> <yloc>336</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -188,7 +183,7 @@ and recruitment_id = '${IDM_ID}';
</sql> </sql>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1568</xloc> <xloc>944</xloc>
<yloc>48</yloc> <yloc>48</yloc>
</GUI> </GUI>
</transform> </transform>
@ -252,7 +247,7 @@ DO UPDATE SET
</partitioning> </partitioning>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>672</xloc> <xloc>480</xloc>
<yloc>48</yloc> <yloc>48</yloc>
</GUI> </GUI>
</transform> </transform>
@ -288,25 +283,7 @@ DO UPDATE SET
<send_true_to>Change job status on success</send_true_to> <send_true_to>Change job status on success</send_true_to>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>1568</xloc> <xloc>944</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream</name>
<type>DetectLastRow</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>672</xloc>
<yloc>208</yloc> <yloc>208</yloc>
</GUI> </GUI>
</transform> </transform>
@ -328,19 +305,11 @@ DO UPDATE SET
<condition>=</condition> <condition>=</condition>
<field>recruit_id</field> <field>recruit_id</field>
<name>recruit_id</name> <name>recruit_id</name>
<name2/>
</key> </key>
<key> <key>
<condition>=</condition> <condition>=</condition>
<field>date_crossing</field> <field>date_crossing</field>
<name>date_crossing</name> <name>date_crossing</name>
<name2/>
</key>
<key>
<condition>=</condition>
<field>return_date</field>
<name>return_date</name>
<name2/>
</key> </key>
<schema>ervu_dashboard</schema> <schema>ervu_dashboard</schema>
<table>border_crossing</table> <table>border_crossing</table>
@ -363,7 +332,7 @@ DO UPDATE SET
<update_bypassed>Y</update_bypassed> <update_bypassed>Y</update_bypassed>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>944</xloc> <xloc>736</xloc>
<yloc>208</yloc> <yloc>208</yloc>
</GUI> </GUI>
</transform> </transform>
@ -371,7 +340,7 @@ DO UPDATE SET
<name>Table input</name> <name>Table input</name>
<type>TableInput</type> <type>TableInput</type>
<description/> <description/>
<distribute>Y</distribute> <distribute>N</distribute>
<custom_distribution/> <custom_distribution/>
<copies>1</copies> <copies>1</copies>
<partitioning> <partitioning>
@ -380,34 +349,19 @@ DO UPDATE SET
</partitioning> </partitioning>
<connection>ervu-dashboard</connection> <connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row> <execute_each_row>N</execute_each_row>
<sql>SELECT <sql>WITH filteredData AS (SELECT ri.recruit_id,
ri.recruit_id, ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr,
CASE ctid
WHEN elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVyezd')::date FROM ervu_dashboard.recruits_info ri
ELSE NULL WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
END as date_crossing, AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
CASE )
WHEN elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$' THEN (elem->>'dataVozvrashh')::date SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing,
ELSE NULL to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date,
END as return_date, true as border_crossed,
true as border_crossed fd.ctid = (select max(ctid) from filteredData) as last_row
FROM ervu_dashboard.recruits_info ri FROM filteredData fd
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem;</sql>
AND '${IDM_ID}' != '' -- Проверка на пустую строку
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
--AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
JOIN LATERAL (
SELECT elem
FROM jsonb_array_elements(
CASE
WHEN jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array'
THEN ri.info->'svedFL'->'extend'->'svedPeresechGran'
ELSE '[]'::jsonb
END
) as elem
WHERE (elem->>'dataVyezd' IS NOT NULL AND elem->>'dataVyezd' ~ '^\d{4}-\d{2}-\d{2}$')
OR (elem->>'dataVozvrashh' IS NOT NULL AND elem->>'dataVozvrashh' ~ '^\d{4}-\d{2}-\d{2}$')
) AS filtered_elems ON true</sql>
<variables_active>Y</variables_active> <variables_active>Y</variables_active>
<attributes/> <attributes/>
<GUI> <GUI>
@ -451,8 +405,8 @@ JOIN LATERAL (
<use_batch>Y</use_batch> <use_batch>Y</use_batch>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>896</xloc> <xloc>736</xloc>
<yloc>416</yloc> <yloc>336</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -485,8 +439,8 @@ JOIN LATERAL (
</fields> </fields>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>672</xloc> <xloc>480</xloc>
<yloc>416</yloc> <yloc>336</yloc>
</GUI> </GUI>
</transform> </transform>
<transform_error_handling> <transform_error_handling>

View file

@ -209,7 +209,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>656</xloc> <xloc>640</xloc>
<yloc>240</yloc> <yloc>240</yloc>
</GUI> </GUI>
</transform> </transform>
@ -260,7 +260,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>672</xloc> <xloc>640</xloc>
<yloc>320</yloc> <yloc>320</yloc>
</GUI> </GUI>
</transform> </transform>
@ -311,8 +311,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>672</xloc> <xloc>640</xloc>
<yloc>384</yloc> <yloc>400</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -362,8 +362,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>672</xloc> <xloc>640</xloc>
<yloc>464</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform_error_handling> <transform_error_handling>

View file

@ -18,28 +18,6 @@
<modified_date>2025/08/05 12:54:50.126</modified_date> <modified_date>2025/08/05 12:54:50.126</modified_date>
</info> </info>
<notepads> <notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>57</height>
<xloc>256</xloc>
<yloc>656</yloc>
<note>+
1.Заменить зашитое название джобы в input на переменную JOB_NAME?</note>
<width>414</width>
</notepad>
</notepads> </notepads>
<order> <order>
<hop> <hop>
@ -347,7 +325,7 @@ where je.status is null or je.status in('ERROR', 'PROCESSING');</sql>
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>560</xloc> <xloc>544</xloc>
<yloc>544</yloc> <yloc>544</yloc>
</GUI> </GUI>
</transform> </transform>

View file

@ -118,8 +118,8 @@ FROM ervu_dashboard.recruitment
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>736</xloc> <xloc>672</xloc>
<yloc>144</yloc> <yloc>160</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -169,7 +169,7 @@ FROM ervu_dashboard.recruitment
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>736</xloc> <xloc>672</xloc>
<yloc>240</yloc> <yloc>240</yloc>
</GUI> </GUI>
</transform> </transform>
@ -220,8 +220,8 @@ FROM ervu_dashboard.recruitment
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>752</xloc> <xloc>672</xloc>
<yloc>336</yloc> <yloc>320</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -271,8 +271,8 @@ FROM ervu_dashboard.recruitment
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>768</xloc> <xloc>672</xloc>
<yloc>416</yloc> <yloc>400</yloc>
</GUI> </GUI>
</transform> </transform>
<transform> <transform>
@ -322,8 +322,8 @@ FROM ervu_dashboard.recruitment
<executors_output_transform/> <executors_output_transform/>
<attributes/> <attributes/>
<GUI> <GUI>
<xloc>752</xloc> <xloc>672</xloc>
<yloc>512</yloc> <yloc>480</yloc>
</GUI> </GUI>
</transform> </transform>
<transform_error_handling> <transform_error_handling>