diff --git a/backend/src/main/java/ru/micord/ervu/account_applications/component/dao/RecruitmentDao.java b/backend/src/main/java/ru/micord/ervu/account_applications/component/dao/RecruitmentDao.java index 1f194538..771e355a 100644 --- a/backend/src/main/java/ru/micord/ervu/account_applications/component/dao/RecruitmentDao.java +++ b/backend/src/main/java/ru/micord/ervu/account_applications/component/dao/RecruitmentDao.java @@ -31,11 +31,17 @@ public class RecruitmentDao { var recruitmentHierarchy = DSL.name("recruitment_hierarchy"); var cte = dslContext.withRecursive(recruitmentHierarchy).as( - dslContext.select(Recruitment.RECRUITMENT.IDM_ID) + dslContext.select( + Recruitment.RECRUITMENT.IDM_ID, + DSL.inline(1).as("depth") + ) .from(Recruitment.RECRUITMENT) .where(DSL.field(field).eq(value)) .unionAll( - dslContext.select(Recruitment.RECRUITMENT.IDM_ID) + dslContext.select( + Recruitment.RECRUITMENT.IDM_ID, + DSL.field(DSL.name("recruitment_hierarchy", "depth"), Integer.class).add(1) + ) .from(Recruitment.RECRUITMENT) .join(DSL.table(recruitmentHierarchy)) .on(Recruitment.RECRUITMENT.PARENT_ID.eq( @@ -48,6 +54,7 @@ public class RecruitmentDao { return cte .select(DSL.field(DSL.name("recruitment_hierarchy", "idm_id"), String.class)) .from(DSL.table(recruitmentHierarchy)) + .orderBy(DSL.field(DSL.name("recruitment_hierarchy", "depth")).asc()) .fetchInto(String.class); } } diff --git a/backend/src/main/java/ru/micord/ervu/account_applications/component/service/RecruitmentComboBoxService.java b/backend/src/main/java/ru/micord/ervu/account_applications/component/service/RecruitmentComboBoxService.java index 03b16b4f..d15e8d8c 100644 --- a/backend/src/main/java/ru/micord/ervu/account_applications/component/service/RecruitmentComboBoxService.java +++ b/backend/src/main/java/ru/micord/ervu/account_applications/component/service/RecruitmentComboBoxService.java @@ -90,8 +90,13 @@ public class RecruitmentComboBoxService extends ComboBoxServiceImpl { loadOptions.addSortField(this.displayColumn, SortOrder.ASC); } - List loadedData = this.loadDao.load(this.getColumnsToLoad(), loadOptions); - return loadedData.stream() + Map dataMap = this.loadDao.load(this.getColumnsToLoad(), loadOptions) + .stream() + .collect(Collectors.toMap(row -> (String)row.get(this.businessIdColumn), row -> row)); + + return recruitmentIds.stream() + .map(dataMap::get) + .filter(Objects::nonNull) .map(this::convertToComboBoxModel) .collect(Collectors.toList()); } diff --git a/resources/src/main/resources/business-model/user_accounts.jrxml b/resources/src/main/resources/business-model/user_accounts.jrxml index 713e70d4..b69482b0 100644 --- a/resources/src/main/resources/business-model/user_accounts.jrxml +++ b/resources/src/main/resources/business-model/user_accounts.jrxml @@ -34,8 +34,7 @@ addinfo.job_position as position, addinfo.user_login as username, array_to_string(ARRAY(select COALESCE(link_ip.ip_address,' ') from public.link_user_application_ip_address as link_ip where link_ip.user_application_list_id=addinfo.user_application_list_id),',') as ip_address -from addinfo order by addinfo.user_application_list_id ASC -]]> +from addinfo order by addinfo.user_application_list_id ASC]]> @@ -167,72 +166,72 @@ from addinfo order by addinfo.user_application_list_id ASC - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/resources/src/main/resources/business-model/Список заявок на пользователя/Создание заявки на добавление пользователя.page b/resources/src/main/resources/business-model/Список заявок на пользователя/Создание заявки на добавление пользователя.page index 58e1941c..facfa472 100644 --- a/resources/src/main/resources/business-model/Список заявок на пользователя/Создание заявки на добавление пользователя.page +++ b/resources/src/main/resources/business-model/Список заявок на пользователя/Создание заявки на добавление пользователя.page @@ -1617,13 +1617,21 @@ ec1fa9b6-04e1-4b58-96c7-538963204d95 Организация false + true + + + b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94 + f8f30f98-1b48-48f7-9cab-4bda644effdf + Combo box_Организация + false + false false - + cssClasses - + "width-full" @@ -1644,10 +1652,10 @@ - + -autocompleteService +comboBoxService @@ -1659,24 +1667,7 @@ columnSorts - - - - -field - - {"schema":"public","table":"recruitment","entity":"recruitment","name":"fullname"} - - - -sortOrder - - "ASC" - - - - - + @@ -1692,40 +1683,26 @@ graph - {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} + {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} - - - - parentControlReference - - null + false - RecruitmentAutoCompleteService + RecruitmentComboBoxService ru.micord.ervu.account_applications.component.service - - - -variable - - "org_unit_id" - - - - - - - + + + + columnForSave @@ -1907,6 +1884,7 @@ 6a35687d-bbb6-4094-86c8-2f414a1ca1e7 Vbox_3 true + false false diff --git a/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на блокировку.page b/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на блокировку.page index 873aa1ab..e8718d23 100644 --- a/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на блокировку.page +++ b/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на блокировку.page @@ -1610,6 +1610,13 @@ + + b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94 + ad5ed255-1755-47a6-89e0-38e60d2f1018 + Combo box_Организация + false + true + @@ -1617,13 +1624,21 @@ ec1fa9b6-04e1-4b58-96c7-538963204d95 Организация false + true + + + b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94 + ad5ed255-1755-47a6-89e0-38e60d2f1018 + Combo box_Организация + false + false false - + cssClasses - + "width-full" @@ -1644,10 +1659,10 @@ - + -autocompleteService +comboBoxService @@ -1659,24 +1674,7 @@ columnSorts - - - - -field - - {"schema":"public","table":"recruitment","entity":"recruitment","name":"fullname"} - - - -sortOrder - - "ASC" - - - - - + @@ -1692,40 +1690,26 @@ graph - {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} + {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} - - - - parentControlReference - - null + false - RecruitmentAutoCompleteService + RecruitmentComboBoxService ru.micord.ervu.account_applications.component.service - - - -variable - - "org_unit_id" - - - - - - - + + + + columnForSave diff --git a/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на изменение.page b/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на изменение.page index cd311582..24b6f3bc 100644 --- a/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на изменение.page +++ b/resources/src/main/resources/business-model/Список заявок на пользователя/Создать заявку на изменение.page @@ -1309,7 +1309,6 @@ ea3759c2-1b7a-45f1-8422-d98df8e10d23 Vbox_2 true - false false @@ -1617,6 +1616,13 @@ + + b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94 + e24e70eb-d639-4be2-87a3-25927a07a229 + Combo box_Организация + false + true + @@ -1624,13 +1630,21 @@ ec1fa9b6-04e1-4b58-96c7-538963204d95 Организация false + true + + + b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94 + e24e70eb-d639-4be2-87a3-25927a07a229 + Combo box_Организация + false + false false - + cssClasses - + "width-full" @@ -1651,10 +1665,10 @@ - + -autocompleteService +comboBoxService @@ -1666,24 +1680,7 @@ columnSorts - - - - -field - - {"schema":"public","table":"recruitment","entity":"recruitment","name":"fullname"} - - - -sortOrder - - "ASC" - - - - - + @@ -1699,40 +1696,26 @@ graph - {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":334.0,"y":161.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} + {"conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"nodeByIndex":{"0":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"nodes":[{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}],"nodeByEntityName":{"recruitment":{"tableName":"recruitment","schemaName":"public","x":326.0,"y":171.0,"alias":"recruitment","conditionGroup":{"operator":"AND","conditions":[],"groups":[]},"emptyEntityAction":"IGNORE_OR_DELETE"}},"matrix":[[null]],"mainNodeIndex":0} - - - - parentControlReference - - null + false - RecruitmentAutoCompleteService + RecruitmentComboBoxService ru.micord.ervu.account_applications.component.service - - - -variable - - "org_unit_id" - - - - - - - + + + + columnForSave