From 309850c0708fdfd910d7245392faad5873b4f958 Mon Sep 17 00:00:00 2001 From: ilyin Date: Fri, 27 Sep 2024 21:15:01 +0300 Subject: [PATCH] fix --- .../config-examples/block.xml | 24 +++++++++---------- .../org/micord/service/RequestService.java | 2 +- .../main/resources/business-model/main.page | 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config-data-executor/config-examples/block.xml b/config-data-executor/config-examples/block.xml index 67d7586..aa243a4 100644 --- a/config-data-executor/config-examples/block.xml +++ b/config-data-executor/config-examples/block.xml @@ -6,9 +6,9 @@ $$ begin update recruits - set current_recruitment_id = '812228fe-42d3-4094-9508-2d1ca2739de8' - ,target_recruitment_id = '812228fe-42d3-4094-9508-2d1ca2739de8' - ,department_id_old = '812228fe-42d3-4094-9508-2d1ca2739de8' + set current_recruitment_id = '04047533-ee2d-4266-b656-e509a547f0e9' + ,target_recruitment_id = '04047533-ee2d-4266-b656-e509a547f0e9' + ,department_id_old = '04047533-ee2d-4266-b656-e509a547f0e9' ,system_pgs_status = '13' ,extra_info = jsonb_set(coalesce(extra_info,'{}'::jsonb), '{blocked}', ('{"cur":'|| coalesce('"'||current_recruitment_id::text||'"','null')|| @@ -39,22 +39,22 @@ DO $$ BEGIN - DELETE FROM subpoena_history where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}; - DELETE FROM subpoena_appearance where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})); - DELETE FROM subpoena_send_info where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})); + DELETE FROM subpoena_history where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}); + DELETE FROM subpoena_appearance where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}); + DELETE FROM subpoena_send_info where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}); DELETE FROM notification_item where restriction_document_item_id in ( select id from restriction_document_item where restriction_document_create_id in ( - select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})))); + select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))); DELETE FROM notification_item where restriction_document_item_id in ( select id from restriction_document_item where restriction_document_cancel_id in ( - select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})))); + select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))); DELETE FROM restriction_document_item where restriction_document_create_id in ( - select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))); + select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})); DELETE FROM restriction_document_item where restriction_document_cancel_id in ( - select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}))); - DELETE FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})); + select id FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments})); + DELETE FROM restriction_document where subpoena_id in (select id FROM subpoena where recruit_id in ${endpointArguments}); DELETE FROM subpoena where recruit_id in ${endpointArguments}; END $$; @@ -80,7 +80,7 @@ BEGIN DELETE FROM incident_history - where incident_id in (select id from incident where recruit_id in ${endpointArguments})); + where incident_id in (select id from incident where recruit_id in ${endpointArguments}); DELETE FROM incident where recruit_id in ${endpointArguments}; END $$; diff --git a/config-data-executor/src/main/java/org/micord/service/RequestService.java b/config-data-executor/src/main/java/org/micord/service/RequestService.java index ec33682..efb9454 100644 --- a/config-data-executor/src/main/java/org/micord/service/RequestService.java +++ b/config-data-executor/src/main/java/org/micord/service/RequestService.java @@ -150,7 +150,7 @@ public class RequestService { private Map buildSqlQuery(SqlRequest request, List ids) { Map resultMap = new HashMap<>(); String endpointArguments = ids.stream() - .map(String::trim) + .map(id -> "'" + id.trim() + "'") .collect(Collectors.joining(", ")); String requestURL = request.getRequestURL(); diff --git a/resources/src/main/resources/business-model/main.page b/resources/src/main/resources/business-model/main.page index c9e012f..6fb97d2 100644 --- a/resources/src/main/resources/business-model/main.page +++ b/resources/src/main/resources/business-model/main.page @@ -48,6 +48,7 @@ 15508c49-88e3-4143-a398-cbfaedc4a59f Tab container true + false false