some fixes

This commit is contained in:
Fusionshh 2025-10-20 13:24:19 +03:00
parent 8d16084e4a
commit 03f8368d20

View file

@ -9,6 +9,16 @@
<pipeline_type>Normal</pipeline_type>
<pipeline_status>0</pipeline_status>
<parameters>
<parameter>
<name>IDM_ID</name>
<default_value>0e0535ab-5303-43ea-b36a-8c0a2a8d0ed5</default_value>
<description/>
</parameter>
<parameter>
<name>JOB_NAME</name>
<default_value>employer_job</default_value>
<description/>
</parameter>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
@ -31,59 +41,49 @@
<to>employer_input</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_input</from>
<to>Identify last row in a stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>employer_upsert</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_upsert</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Detect empty stream</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Filter rows</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_input</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>filter_non_actual_employers</from>
<to>Update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<from>employer_input</from>
<to>filter_non_actual_employers</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_upsert</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_input</from>
<to>employer_upsert</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_upsert</from>
<to>Block until transforms finish</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Block until transforms finish</from>
<to>Filter rows</to>
<from>Detect empty stream</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
</order>
@ -103,30 +103,8 @@
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1520</xloc>
<yloc>560</yloc>
</GUI>
</transform>
<transform>
<name>Block until transforms finish</name>
<type>BlockUntilTransformsFinish</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<transforms>
<transform>
<name>Update</name>
</transform>
</transforms>
<attributes/>
<GUI>
<xloc>1328</xloc>
<yloc>400</yloc>
<xloc>1184</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform>
@ -145,7 +123,7 @@
<name>error_description</name>
</argument>
</arguments>
<connection>ervu-dashboard</connection>
<connection>ervu-dashboard-118</connection>
<execute_each_row>Y</execute_each_row>
<quoteString>N</quoteString>
<replace_variables>Y</replace_variables>
@ -161,8 +139,8 @@ and recruitment_id = '${IDM_ID}';
</sql>
<attributes/>
<GUI>
<xloc>1136</xloc>
<yloc>560</yloc>
<xloc>976</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform>
@ -179,8 +157,11 @@ and recruitment_id = '${IDM_ID}';
<arguments>
</arguments>
<connection>ervu-dashboard</connection>
<delete_field/>
<execute_each_row>Y</execute_each_row>
<insert_field/>
<quoteString>N</quoteString>
<read_field/>
<replace_variables>Y</replace_variables>
<set_params>N</set_params>
<single_statement>N</single_statement>
@ -191,9 +172,10 @@ WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';
</sql>
<update_field/>
<attributes/>
<GUI>
<xloc>1520</xloc>
<xloc>1280</xloc>
<yloc>256</yloc>
</GUI>
</transform>
@ -211,8 +193,11 @@ and recruitment_id = '${IDM_ID}';
<arguments>
</arguments>
<connection>ervu-dashboard</connection>
<delete_field/>
<execute_each_row>N</execute_each_row>
<insert_field/>
<quoteString>N</quoteString>
<read_field/>
<replace_variables>Y</replace_variables>
<set_params>N</set_params>
<single_statement>N</single_statement>
@ -223,6 +208,7 @@ DO UPDATE
SET status = 'PROCESSING',
error_description = null,
execution_datetime = current_timestamp;</sql>
<update_field/>
<attributes/>
<GUI>
<xloc>352</xloc>
@ -242,7 +228,7 @@ SET status = 'PROCESSING',
</partitioning>
<attributes/>
<GUI>
<xloc>704</xloc>
<xloc>544</xloc>
<yloc>256</yloc>
</GUI>
</transform>
@ -279,25 +265,7 @@ SET status = 'PROCESSING',
<send_true_to>Change job status on success</send_true_to>
<attributes/>
<GUI>
<xloc>1520</xloc>
<yloc>400</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>704</xloc>
<xloc>1280</xloc>
<yloc>400</yloc>
</GUI>
</transform>
@ -315,11 +283,13 @@ SET status = 'PROCESSING',
<commit>10000</commit>
<connection>ervu-dashboard</connection>
<error_ignored>N</error_ignored>
<ignore_flag_field/>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
@ -332,15 +302,15 @@ SET status = 'PROCESSING',
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>896</xloc>
<yloc>560</yloc>
<xloc>736</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform>
<name>employer_input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
@ -350,21 +320,24 @@ SET status = 'PROCESSING',
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>with filteredData as (select ri.recruit_id,
<sql>with filteredData as (
select ri.recruit_id,
ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' as rabotodat,
true as actual_employer
true as actual_employer,
ctid
from ervu_dashboard.recruits_info ri
where ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat' != 'null'
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
where COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'aktRabotodat') &lt;&gt; 'null'
union all
select ri.recruit_id,
ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' as rabotodat,
false as actual_employer
false as actual_employer,
ctid
from ervu_dashboard.recruits_info ri
where ri.info -> 'svedFL' -&gt; 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat' != 'null'
AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
where COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
and (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'predRabotodat') &lt;&gt; 'null'
)
select
fd.recruit_id,
@ -381,7 +354,7 @@ select
when rabotodat ->> 'svedGlKFH' is not null and rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
when rabotodat ->> 'svedPlatFL' is not null and rabotodat ->> 'svedPlatFL' != 'null' then 'Физическое лицо'
end as employer_category_name,
rabotodat -> 'svedYUL' -> 'naimOrg' as name,
rabotodat -> 'svedYUL' ->> 'naimOrg' as name,
case
when rabotodat ->> 'svedIP' is not null and rabotodat ->> 'svedIP' != 'null'
then rabotodat -> 'svedIP' ->> 'innfl'
@ -404,7 +377,8 @@ select
end as kpp,
coalesce(rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1' as is_opk_org,
actual_employer,
coalesce(rabotodat -> 'extend' ->> 'statusRabotodat', '0') = '1' as status
coalesce(rabotodat -> 'extend' ->&gt; 'statusRabotodat', '0') = '1' as status,
fd.ctid = (select max(ctid) from filteredData) as last_row
from filteredData fd;</sql>
<variables_active>Y</variables_active>
<attributes/>
@ -431,6 +405,7 @@ from filteredData fd;</sql>
<condition>=</condition>
<field>source_id</field>
<name>source_id</name>
<name2/>
</key>
<schema>ervu_dashboard</schema>
<table>employer</table>
@ -508,7 +483,7 @@ from filteredData fd;</sql>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1136</xloc>
<xloc>976</xloc>
<yloc>400</yloc>
</GUI>
</transform>
@ -544,8 +519,8 @@ from filteredData fd;</sql>
<send_true_to>Update</send_true_to>
<attributes/>
<GUI>
<xloc>704</xloc>
<yloc>560</yloc>
<xloc>544</xloc>
<yloc>608</yloc>
</GUI>
</transform>
<transform_error_handling>