diff --git a/com.actionsoft.apps.coe.pal.processlist/lib/com.actionsoft.apps.coe.pal.processlist.jar b/com.actionsoft.apps.coe.pal.processlist/lib/com.actionsoft.apps.coe.pal.processlist.jar index ec06e91c..866c26e6 100644 Binary files a/com.actionsoft.apps.coe.pal.processlist/lib/com.actionsoft.apps.coe.pal.processlist.jar and b/com.actionsoft.apps.coe.pal.processlist/lib/com.actionsoft.apps.coe.pal.processlist.jar differ diff --git a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ExportAPIManager.java b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ExportAPIManager.java index 3282d69e..668a828f 100644 --- a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ExportAPIManager.java +++ b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ExportAPIManager.java @@ -50,6 +50,7 @@ public class ExportAPIManager { try { exportDao.insert(exportModel); } catch (AWSDataAccessException e) { + e.printStackTrace(); return null; } // 加入缓存 diff --git a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ProcessListUtil.java b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ProcessListUtil.java index c2036570..1e5aa15a 100644 --- a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ProcessListUtil.java +++ b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/util/ProcessListUtil.java @@ -11,6 +11,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.Design import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel; +import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl; import com.actionsoft.bpms.commons.login.constant.LoginConst; import com.actionsoft.bpms.org.model.DepartmentModel; import com.actionsoft.bpms.org.model.RoleModel; @@ -177,4 +178,46 @@ public class ProcessListUtil { } return result; } + + /** + * 获取模型数据的真实层级level RepositoryModel + * @param model + * @return + */ + public static PALRepositoryModel getRealLevelRepository(PALRepositoryModel model) { + PALRepositoryModelImpl newModel = null; + try { + newModel = ((PALRepositoryModelImpl) model).clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + if (newModel != null) { + Set pids = new HashSet<>(); + int level = 1; + StringBuilder sBuilder = new StringBuilder(); + String pid = newModel.getParentId(); + while (pid.length() >= 36 && !pids.contains(pid)) { + pids.add(pid); + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid); + if (parentModel == null) { + List versionList = PALRepositoryCache.getByVersionId(model.getWsId(), pid); + if (versionList != null && versionList.size() > 0) { + for (PALRepositoryModel m : versionList) { + if (m.isUse()) { + parentModel = m; + break; + } + } + } + } + if (parentModel != null) { + level++; + pid = parentModel.getParentId(); + } + } + newModel.setLevel(level); + } + return newModel; + } + } diff --git a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java index 1e08d193..67466765 100644 --- a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java +++ b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java @@ -137,6 +137,7 @@ public class PALRepositoryListWeb extends ActionWeb { int maxLevel = 0; while (iterator.hasNext()) { PALRepositoryModel next = iterator.next(); + PALRepositoryModel model = ProcessListUtil.getRealLevelRepository(next); if (!UtilString.isEmpty(category)) { if (!category.equals(next.getMethodCategory())) { continue; @@ -147,8 +148,8 @@ public class PALRepositoryListWeb extends ActionWeb { continue; } } - if (next.getLevel() > maxLevel) { - maxLevel = next.getLevel(); + if (model.getLevel() > maxLevel) { + maxLevel = model.getLevel(); } } JSONArray result = new JSONArray(); @@ -641,6 +642,12 @@ public class PALRepositoryListWeb extends ActionWeb { List palList = new ArrayList<>(); Set ids = new HashSet<>(); PALRepositoryCache.getAllChildrenModelsByPid(wsId, category, palList, ids); + // 重新设置pllevel + for (int i = 0; i < palList.size(); i++) { + palList.set(i, ProcessListUtil.getRealLevelRepository(palList.get(i))); + } + + // 获取所有正在设计中的 List tmpPalList = new ArrayList<>(); Set levelSet = new HashSet<>();