From 4f8495cbecb05026f3deac0c5776c6a39bc93f49 Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Thu, 22 Feb 2024 17:52:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E6=95=B0=E6=8D=AE=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1096897488453632]表单实例数据抽离 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1096897488453632 --- .../stephandler/CiEntitySyncProcessComponent.java | 12 +++++++----- .../stephandler/CmdbSyncProcessComponent.java | 4 +++- .../workerdispatcher/handler/CmdbDispatcher.java | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/process/stephandler/CiEntitySyncProcessComponent.java b/src/main/java/neatlogic/module/cmdb/process/stephandler/CiEntitySyncProcessComponent.java index 5ff41177..c82d012c 100644 --- a/src/main/java/neatlogic/module/cmdb/process/stephandler/CiEntitySyncProcessComponent.java +++ b/src/main/java/neatlogic/module/cmdb/process/stephandler/CiEntitySyncProcessComponent.java @@ -29,8 +29,10 @@ import neatlogic.framework.cmdb.enums.EditModeType; import neatlogic.framework.cmdb.enums.TransactionActionType; import neatlogic.framework.cmdb.exception.cientity.NewCiEntityNotFoundException; import neatlogic.framework.common.constvalue.InputFrom; +import neatlogic.framework.crossover.CrossoverServiceFactory; import neatlogic.framework.exception.core.ApiRuntimeException; import neatlogic.framework.process.constvalue.ProcessStepMode; +import neatlogic.framework.process.crossover.IProcessTaskCrossoverService; import neatlogic.framework.process.dao.mapper.ProcessTaskStepDataMapper; import neatlogic.framework.process.dto.ProcessTaskFormAttributeDataVo; import neatlogic.framework.process.dto.ProcessTaskStepDataVo; @@ -53,6 +55,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; //@Service @Deprecated @@ -124,12 +127,11 @@ public class CiEntitySyncProcessComponent extends ProcessStepHandlerBase { if (MapUtils.isNotEmpty(stepConfigObj)) { JSONArray handlerList = stepConfigObj.getJSONArray("handlerList"); if (CollectionUtils.isNotEmpty(handlerList)) { + IProcessTaskCrossoverService processTaskCrossoverService = CrossoverServiceFactory.getApi(IProcessTaskCrossoverService.class); + List processTaskFormAttributeDataList = processTaskCrossoverService.getProcessTaskFormAttributeDataListByProcessTaskId(currentProcessTaskStepVo.getProcessTaskId()); + Map processTaskFormAttributeDataMap = processTaskFormAttributeDataList.stream().collect(Collectors.toMap(e -> e.getAttributeUuid(), e -> e)); for (int hIndex = 0; hIndex < handlerList.size(); hIndex++) { - ProcessTaskFormAttributeDataVo p = new ProcessTaskFormAttributeDataVo(); - p.setProcessTaskId(currentProcessTaskStepVo.getProcessTaskId()); - p.setAttributeUuid(handlerList.getString(hIndex)); - ProcessTaskFormAttributeDataVo processTaskFormAttributeDataVo = - processTaskMapper.getProcessTaskFormAttributeDataByProcessTaskIdAndAttributeUuid(p); + ProcessTaskFormAttributeDataVo processTaskFormAttributeDataVo = processTaskFormAttributeDataMap.get(handlerList.getString(hIndex)); if (processTaskFormAttributeDataVo != null) { JSONArray dataList = JSON.parseArray(processTaskFormAttributeDataVo.getData()); for (int dIndex = 0; dIndex < dataList.size(); dIndex++) { diff --git a/src/main/java/neatlogic/module/cmdb/process/stephandler/CmdbSyncProcessComponent.java b/src/main/java/neatlogic/module/cmdb/process/stephandler/CmdbSyncProcessComponent.java index f902137b..792893ff 100644 --- a/src/main/java/neatlogic/module/cmdb/process/stephandler/CmdbSyncProcessComponent.java +++ b/src/main/java/neatlogic/module/cmdb/process/stephandler/CmdbSyncProcessComponent.java @@ -49,6 +49,7 @@ import neatlogic.framework.process.constvalue.ProcessStepMode; import neatlogic.framework.process.constvalue.ProcessTaskAuditType; import neatlogic.framework.process.constvalue.ProcessTaskOperationType; import neatlogic.framework.process.constvalue.automatic.FailPolicy; +import neatlogic.framework.process.crossover.IProcessTaskCrossoverService; import neatlogic.framework.process.dao.mapper.ProcessTaskStepDataMapper; import neatlogic.framework.process.dto.*; import neatlogic.framework.process.exception.processtask.ProcessTaskException; @@ -569,7 +570,8 @@ public class CmdbSyncProcessComponent extends ProcessStepHandlerBase { ProcessTaskFormVo processTaskFormVo = processTaskMapper.getProcessTaskFormByProcessTaskId(processTaskId); if (processTaskFormVo != null) { formConfig = selectContentByHashMapper.getProcessTaskFromContentByHash(processTaskFormVo.getFormContentHash()); - List processTaskFormAttributeDataList = processTaskMapper.getProcessTaskStepFormAttributeDataByProcessTaskId(processTaskId); + IProcessTaskCrossoverService processTaskCrossoverService = CrossoverServiceFactory.getApi(IProcessTaskCrossoverService.class); + List processTaskFormAttributeDataList = processTaskCrossoverService.getProcessTaskFormAttributeDataListByProcessTaskId(processTaskId); if (CollectionUtils.isNotEmpty(processTaskFormAttributeDataList)) { for (ProcessTaskFormAttributeDataVo attributeDataVo : processTaskFormAttributeDataList) { Object dataObj = formAttributeDataAdaptsToCmdb(attributeDataVo.getAttributeUuid(), attributeDataVo.getDataObj(), formConfig); diff --git a/src/main/java/neatlogic/module/cmdb/workerdispatcher/handler/CmdbDispatcher.java b/src/main/java/neatlogic/module/cmdb/workerdispatcher/handler/CmdbDispatcher.java index 7a7c80d0..2381946e 100644 --- a/src/main/java/neatlogic/module/cmdb/workerdispatcher/handler/CmdbDispatcher.java +++ b/src/main/java/neatlogic/module/cmdb/workerdispatcher/handler/CmdbDispatcher.java @@ -23,6 +23,7 @@ import neatlogic.framework.dto.UserVo; import neatlogic.framework.form.constvalue.FormHandler; import neatlogic.framework.form.service.IFormCrossoverService; import neatlogic.framework.process.constvalue.ProcessUserType; +import neatlogic.framework.process.crossover.IProcessTaskCrossoverService; import neatlogic.framework.process.dao.mapper.ProcessTaskMapper; import neatlogic.framework.process.dao.mapper.SelectContentByHashMapper; import neatlogic.framework.process.dto.ProcessTaskFormAttributeDataVo; @@ -401,7 +402,8 @@ public class CmdbDispatcher extends WorkerDispatcherBase { ProcessTaskFormVo processTaskFormVo = processTaskMapper.getProcessTaskFormByProcessTaskId(processTaskId); if (processTaskFormVo != null) { formConfig = selectContentByHashMapper.getProcessTaskFromContentByHash(processTaskFormVo.getFormContentHash()); - List processTaskFormAttributeDataList = processTaskMapper.getProcessTaskStepFormAttributeDataByProcessTaskId(processTaskId); + IProcessTaskCrossoverService processTaskCrossoverService = CrossoverServiceFactory.getApi(IProcessTaskCrossoverService.class); + List processTaskFormAttributeDataList = processTaskCrossoverService.getProcessTaskFormAttributeDataListByProcessTaskId(processTaskId); if (CollectionUtils.isNotEmpty(processTaskFormAttributeDataList)) { for (ProcessTaskFormAttributeDataVo attributeDataVo : processTaskFormAttributeDataList) { Object dataObj = formAttributeDataAdaptsToCmdb(attributeDataVo.getAttributeUuid(), attributeDataVo.getDataObj(), formConfig); -- Gitee