some fixes

This commit is contained in:
Fusionshh 2025-10-20 22:48:41 +03:00
parent fee1f124b8
commit 0cdc8cffc6

View file

@ -36,16 +36,6 @@
<to>Abort</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_output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_output</from>
<to>Change job status on error</to>
@ -61,16 +51,6 @@
<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>Identify last row in a stream</from>
<to>filter_non_actual_employers</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>filter_non_actual_employers</from>
<to>Update</to>
@ -82,18 +62,28 @@
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_output</from>
<to>Block until transforms finish</to>
<from>Create job execution record</from>
<to>employer_input</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Block until transforms finish</from>
<from>employer_output</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Create job execution record</from>
<to>employer_input</to>
<from>employer_input</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_input</from>
<to>filter_non_actual_employers</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>employer_input</from>
<to>employer_output</to>
<enabled>Y</enabled>
</hop>
</order>
@ -117,28 +107,6 @@
<yloc>448</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>1120</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Change job status on error</name>
<type>ExecSql</type>
@ -289,24 +257,6 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<yloc>288</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>528</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Update</name>
<type>Update</type>
@ -346,7 +296,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<name>employer_input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
@ -356,21 +306,24 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
<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,
@ -387,7 +340,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'
@ -410,12 +363,13 @@ 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/>
<GUI>
<xloc>352</xloc>
<xloc>528</xloc>
<yloc>288</yloc>
</GUI>
</transform>