From c246132121614795731594348868890f0cb866d6 Mon Sep 17 00:00:00 2001 From: malkov34 Date: Wed, 4 Sep 2024 16:33:44 +0300 Subject: [PATCH] =?UTF-8?q?SUPPORT-8529:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D1=8B=20=D0=B2=D0=B7=D0=B0=D0=B8=D0=BC=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8=D1=8F=20=D1=81=20Con?= =?UTF-8?q?figDataExecutor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/rpc/ConfigExecutorRpcService.java | 27 +++++ .../java/service/ConfigExecutorService.java | 31 +++++ config/standalone.xml | 2 + .../app/component/ConfigExecuteBtn.html | 9 ++ frontend/src/ts/ervu/ConfigExecuteBtn.ts | 42 +++++++ .../business-model/ConfigExecuteBtn.component | 38 ++++++ .../main_process/main_page.page | 109 ++++++++---------- 7 files changed, 197 insertions(+), 61 deletions(-) create mode 100644 backend/src/main/java/rpc/ConfigExecutorRpcService.java create mode 100644 backend/src/main/java/service/ConfigExecutorService.java create mode 100644 frontend/src/resources/template/app/component/ConfigExecuteBtn.html create mode 100644 frontend/src/ts/ervu/ConfigExecuteBtn.ts create mode 100644 resources/src/main/resources/business-model/ConfigExecuteBtn.component diff --git a/backend/src/main/java/rpc/ConfigExecutorRpcService.java b/backend/src/main/java/rpc/ConfigExecutorRpcService.java new file mode 100644 index 0000000..992009c --- /dev/null +++ b/backend/src/main/java/rpc/ConfigExecutorRpcService.java @@ -0,0 +1,27 @@ +package rpc; + +import org.springframework.beans.factory.annotation.Autowired; +import ru.cg.webbpm.modules.webkit.annotations.RpcCall; +import ru.cg.webbpm.modules.webkit.annotations.RpcService; +import ru.cg.webbpm.modules.webkit.beans.Behavior; +import service.ConfigExecutorService; + +import java.util.List; + +/** + * @author Evgenii Malkov + */ +@RpcService +public class ConfigExecutorRpcService extends Behavior { + + private final ConfigExecutorService configExecutorService; + + public ConfigExecutorRpcService(@Autowired ConfigExecutorService configExecutorService) { + this.configExecutorService = configExecutorService; + } + + @RpcCall + public void callConfigExecutor(String path, List ids) { + configExecutorService.callConfigExecutor(path, ids); + } +} diff --git a/backend/src/main/java/service/ConfigExecutorService.java b/backend/src/main/java/service/ConfigExecutorService.java new file mode 100644 index 0000000..f49b4dd --- /dev/null +++ b/backend/src/main/java/service/ConfigExecutorService.java @@ -0,0 +1,31 @@ +package service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.lang.invoke.MethodHandles; +import java.util.List; + +/** + * @author Evgenii Malkov + */ +@Service +public class ConfigExecutorService { + + @Value("${config-data-executor.host}") + String host; + @Value("${config-data-executor.port}") + String port; + + private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + + public void callConfigExecutor(String path, List ids) { + LOGGER.info("host: " + host); + LOGGER.info("port " + port); + LOGGER.info("path: " + path); + ids.forEach(LOGGER::info); + } +} diff --git a/config/standalone.xml b/config/standalone.xml index 016769f..55fb5ce 100644 --- a/config/standalone.xml +++ b/config/standalone.xml @@ -54,6 +54,8 @@ + + diff --git a/frontend/src/resources/template/app/component/ConfigExecuteBtn.html b/frontend/src/resources/template/app/component/ConfigExecuteBtn.html new file mode 100644 index 0000000..22b3e99 --- /dev/null +++ b/frontend/src/resources/template/app/component/ConfigExecuteBtn.html @@ -0,0 +1,9 @@ +
+ +
diff --git a/frontend/src/ts/ervu/ConfigExecuteBtn.ts b/frontend/src/ts/ervu/ConfigExecuteBtn.ts new file mode 100644 index 0000000..92bf9d7 --- /dev/null +++ b/frontend/src/ts/ervu/ConfigExecuteBtn.ts @@ -0,0 +1,42 @@ +import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef} from "@angular/core"; +import {AbstractButton, NotNull, ObjectRef, TextArea} from "@webbpm/base-package"; +import {ConfigExecutorRpcService} from "../generated/rpc/ConfigExecutorRpcService"; + +/** + * @author: a.petrov + */ +@Component({ + moduleId: module.id, + selector: 'button-component', + templateUrl: './../../../src/resources/template/app/component/ConfigExecuteBtn.html', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ConfigExecuteBtn extends AbstractButton { + + @ObjectRef() + @NotNull() + public ervuIdField: TextArea; + @NotNull() + public methodPath: string; + private script: ConfigExecutorRpcService; + + constructor(el: ElementRef, cd: ChangeDetectorRef) { + super(el, cd); + } + + public initialize() { + super.initialize(); + this.script = this.getScript(ConfigExecutorRpcService) + } + + doClickActions(): Promise { + const methodPath = this.methodPath; + const idsValue = this.ervuIdField.getValue(); + this.script.callConfigExecutor(methodPath, idsValue, true); + return Promise.resolve(); + } + + protected getFocusElement(): HTMLInputElement { + return this.el.nativeElement.querySelector('button'); + } +} diff --git a/resources/src/main/resources/business-model/ConfigExecuteBtn.component b/resources/src/main/resources/business-model/ConfigExecuteBtn.component new file mode 100644 index 0000000..20df232 --- /dev/null +++ b/resources/src/main/resources/business-model/ConfigExecuteBtn.component @@ -0,0 +1,38 @@ + + + 8a93fb89-9703-41de-95ec-ec1f700b12f5 + ConfigExecuteBtn + false + + 3.175.1-SUPPORT-8427v3-SNAPSHOT + + + ru.cg.webbpm.packages.base.resources + 3.175.1-8427v4-SNAPSHOT + + + + + c8dfe691-a84a-48da-b79e-6298d90db71d + 491f2de3-6427-4144-afbd-d586e3789b05 + ConfigExecuteBtn + false + false + + + + caption + + "Удалить данные по гражданам" + + + + navigateTo + + "delete" + + + + + + diff --git a/resources/src/main/resources/business-model/main_process/main_page.page b/resources/src/main/resources/business-model/main_process/main_page.page index 2ecc078..e1de647 100644 --- a/resources/src/main/resources/business-model/main_process/main_page.page +++ b/resources/src/main/resources/business-model/main_process/main_page.page @@ -400,20 +400,6 @@ false true - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 2f80169f-cb77-4b05-8f00-24717bb10507 - SQL удаление граждан из списка на вызов ЕРВУ - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 6da552a8-56a0-4593-b6ea-ec93eb17f9f8 - SQL перевод граждан в статус «состоит на учете» - false - true - c8dfe691-a84a-48da-b79e-6298d90db71d f7553607-7133-4e0c-88dc-1c2d2ef3f174 @@ -849,13 +835,38 @@ - - c8dfe691-a84a-48da-b79e-6298d90db71d - 05c32fb0-b9ce-49c5-a58e-117ffa813578 - Navigation Удалить данные по гражданам + + 491f2de3-6427-4144-afbd-d586e3789b05 + b1eb1925-d767-4e3f-ba59-b8f1c152de9a + ConfigExecuteBtn Удалить данные по гражданам false false + false + + +visible + + false + + + + + + + ConfigExecutorRpcService + rpc + + true + true + + + + ConfigExecuteBtn + ervu + + true + true caption @@ -864,9 +875,27 @@ -navigateTo +confirmationText + + null + + + +ervuIdField + + {"objectId":"663b3639-2a6b-4f3d-b0a0-2ba829de6ea4","packageName":"component.field","className":"TextArea","type":"TS"} + + + +methodPath "delete" + + + +visible + + true @@ -1256,48 +1285,6 @@ false true - - 98594cec-0a9b-4cef-af09-e1b71cb2ad9e - 6274524c-0f28-4028-a08d-9523ef7e4dcc - AC_lock - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 87b02ec5-54b8-432a-b9e8-67530c4c22d4 - SQL блокировка рекрута в 13 - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 64c555f4-4ace-4925-a7d9-601625723ab2 - SQL удаление повесток и мер без удаления рекрута - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 4a50e271-338a-4e02-a339-92817b4f89f7 - SQL удаление инцидентов по рекруту - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - eabba59b-a69a-49b7-bb89-abf7b57a8ed2 - SQL уведомления гражданина через ЕПГУ - false - true - - - 57c7cd21-1556-4dbd-b9da-33520486a1db - 4e0d797b-8b42-43c3-b3a8-08cff21f2c7d - SQL версионные журналы - false - true - c8dfe691-a84a-48da-b79e-6298d90db71d c72d5f68-82f1-4f82-a7d5-0b3fe0a7fe91