From 9f79f45f66642953302676a316e95311b48baa0b Mon Sep 17 00:00:00 2001 From: "446052889@qq.com" <446052889@qq.com> Date: Tue, 9 Aug 2022 14:58:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96Aris?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=90=8D=E7=A7=B0=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pal/datamigration/util/ProcessUtil.java | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/ProcessUtil.java b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/ProcessUtil.java index e6e353ce..8c7d3bf5 100644 --- a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/ProcessUtil.java +++ b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/ProcessUtil.java @@ -223,7 +223,7 @@ public class ProcessUtil { } /** - * 获取所有epc模型,key:epc-id,value:arisUrl + * 获取所有epc模型的Aris地址路径(包括Aris流程名称),key:epc-id,value:arisUrl * @param wsId * @return */ @@ -271,5 +271,59 @@ public class ProcessUtil { } return propValMap; } + + /** + * 获取所有epc模型的Aris流程名称 + * @param wsId + * @return + */ + public static Map getPalRepositoryArisNameMap(String wsId) { + Map propValMap = new HashMap<>(); + Iterator iterator = PALRepositoryCache.getByWsId(wsId); + List list = new ArrayList<>(); + + // 过滤epc + while (iterator.hasNext()) { + PALRepositoryModel model = iterator.next(); + if (Constant.PROCESS_EPC.equals(model.getMethodId())) { + list.add(model); + } + } + // 找到最新版本,只匹配最新版本(在日志中添加此明显提示) + List recentVerList = new ArrayList<>(); + Map modelMap = new HashMap<>(); + for (PALRepositoryModel model : list) { + if (!modelMap.containsKey(model.getVersionId())) { + modelMap.put(model.getVersionId(), model); + } else { + if (modelMap.get(model.getVersionId()).getVersion() < model.getVersion()) { + modelMap.put(model.getVersionId(), model); + } + } + } + for (Map.Entry entry : modelMap.entrySet()) { + recentVerList.add(entry.getValue()); + } + list = recentVerList; + + PALRepositoryPropertyDao dao = new PALRepositoryPropertyDao(); + // aris流程名称 + List arisNameModels = dao.queryByWsId(wsId); + arisNameModels = arisNameModels.stream().filter(item -> Constant.METHOD_ARIS_NAME.equals(item.getPropertyId())).collect(Collectors.toList()); + Map arisNameMap = new HashMap<>(); + for (PALRepositoryPropertyModel prop : arisNameModels) { + arisNameMap.put(prop.getPlId(), StrUtil.removeAllBlack(prop.getPropertyValue()));// 去除空格 + } + for (PALRepositoryModel model : list) { + if (arisNameMap.containsKey(model.getId())) { + List pathList = new ArrayList<>(); + if (UtilString.isNotEmpty(arisNameMap.get(model.getId()))) { + propValMap.put(model.getId(), arisNameMap.get(model.getId())); + } + + } + } + return propValMap; + } }