diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index 99edaacf..22abeaa7 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/cache/PALRepositoryCache.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/cache/PALRepositoryCache.java index 136c9836..ebcd7f33 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/cache/PALRepositoryCache.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/cache/PALRepositoryCache.java @@ -66,6 +66,10 @@ public class PALRepositoryCache extends Cache { return getCache().getByIndex(PALRepositoryCacheIndex1.class, wsId); } + public static List getListByWsId(String wsId) { + return iteratorToList(getByWsId(wsId)); + } + // 获取当前流程id的第一级子节点流程 public static Iterator getByPid(String wsId, String pid) { return getCache().getByIndex(PALRepositoryCacheIndex2.class, wsId + "_" + pid); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java index 0fec4ad1..c343d101 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java @@ -5084,14 +5084,40 @@ public class CoeDesignerWeb extends ActionWeb { */ public String deletePalDesignerVersion(String wsId, String teamId, String id) { ResponseObject ro; - PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id); + PALRepository dao = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); + PALRepositoryModel plModel = dao.getInstance(id); List list = new ArrayList(); list.add(plModel); + // 同时将相关的角色图、绩效图也放入回收站 + if ("process.bpmn2,process.epc,process.flowchart".contains(plModel.getMethodId())) { + List data1 = new ArrayList(); + data1.add(0, "org.role"); + data1.add(1, plModel.getId().trim()); + List data2 = new ArrayList(); + data2.add(0, "control.kpi"); + data2.add(1, plModel.getId().trim()); + List confidentialList = new ArrayList(); + confidentialList.add(data1.toString()); + List tmpList1 = dao.searchRepositoryByMethodIdAndExt2("org.role", confidentialList); + if (CollectionUtils.isNotEmpty(tmpList1)) { + list.addAll(tmpList1); + } + confidentialList.set(0, data2.toString()); + List tmpList2 = dao.searchRepositoryByMethodIdAndExt2("control.kpi", confidentialList); + if (CollectionUtils.isNotEmpty(tmpList2)) { + list.addAll(tmpList2); + } + } + CoeProcessRecycleWeb recycleWeb = new CoeProcessRecycleWeb(_uc); boolean insertFlag = recycleWeb.saveRecycleProcesses(plModel, list); // 流程信息存入回收站 if (insertFlag) { - CoeProcessLevelDaoFacotory.createCoeProcessLevel().deletePalRepositoryVersion(id); + List idList = new ArrayList<>(); + for (PALRepositoryModel model : list) { + idList.add(model.getId()); + } + CoeProcessLevelDaoFacotory.createCoeProcessLevel().removeProcessLevel(StringUtils.join(idList, ","));// 删除流程 CoeProcessLevelNoCache.getInstance().reloadInBackground(plModel.getWsId()); // 重新装载编号 ro = ResponseObject.newOkResponse(); ro.msg("已放入回收站"); @@ -5099,7 +5125,6 @@ public class CoeDesignerWeb extends ActionWeb { if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_DELETE, CoEOpLogConst.INFO_REPOSITORY_VERSION_DELETE); } - deletePalCorrelationModel(wsId, teamId, id); } else { ro = ResponseObject.newErrResponse(); ro.msg("删除失败"); @@ -5107,48 +5132,6 @@ public class CoeDesignerWeb extends ActionWeb { return ro.toString(); } - /** - * 同步删除关联绩效角色数据模型 - * - * @param wsId - * @param teamId - * @param id - * @return - */ - public String deletePalCorrelationModel(String wsId, String teamId, String id) { - ResponseObject ro = ResponseObject.newOkResponse(); - DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); - List oldModelList = dao.getModelListByFileId(id); - - if (oldModelList.size() > 0) { - DesignerShapeRelationModel oldModel = oldModelList.get(0); - //如果关联角色图,则同步复制角色图关联关系 - String methodIds = ""; - if (oldModel.getAttrId().equals("role")) { - PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(oldModel.getRelationFileId()); - List list = new ArrayList(); - list.add(plModel); - CoeProcessRecycleWeb recycleWeb = new CoeProcessRecycleWeb(_uc); - boolean insertFlag = recycleWeb.saveRecycleProcesses(plModel, list); // 流程信息存入回收站 - - if (insertFlag) { - CoeProcessLevelDaoFacotory.createCoeProcessLevel().deletePalRepositoryVersion(oldModel.getRelationFileId()); - CoeProcessLevelNoCache.getInstance().reloadInBackground(plModel.getWsId()); // 重新装载编号 - ro.msg("已放入回收站"); - // 操作行为日志记录 - if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { - CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_DELETE, CoEOpLogConst.INFO_REPOSITORY_VERSION_DELETE); - } - } else { - ro = ResponseObject.newErrResponse(); - ro.msg("删除失败"); - } - } - } - - return ro.toString(); - } - /** * 设计器-切换版本状态为使用中 * diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index c1d82026..40602e0e 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -3798,6 +3798,31 @@ public class CoeProcessLevelWeb extends ActionWeb { String parentVersionId = model.getParentId(); List list = dao.getAllRepositoryByVersionId(model.getVersionId()); // versionId相同的流程 PALRepositoryQueryAPIManager.getInstance().getAllPalRepositoryModelsByPid(model.getWsId(), model.getId(), list); + // 同时将相关的角色图、绩效图也放入回收站 + List tmpList= new ArrayList<>(); + List allList = PALRepositoryCache.getListByWsId(model.getWsId()); + Map> mapByExt2 = allList.stream() + .filter(m -> "org.role".equals(m.getMethodId()) || "control.kpi".equals(m.getMethodId())) + .collect(Collectors.groupingBy( + m -> m.getExt2() != null ? m.getExt2() : "DEFAULT_KEY" + )); + for (PALRepositoryModel removeModel : list) { + if ("process.bpmn2,process.epc,process.flowchart".contains(removeModel.getMethodId())) { + List data1 = new ArrayList(); + data1.add(0, "org.role"); + data1.add(1, removeModel.getId().trim()); + List data2 = new ArrayList(); + data2.add(0, "control.kpi"); + data2.add(1, removeModel.getId().trim()); + if (mapByExt2.containsKey(data1.toString())) { + tmpList.addAll(mapByExt2.get(data1.toString())); + } else if (mapByExt2.containsKey(data2.toString())) { + tmpList.addAll(mapByExt2.get(data2.toString())); + } + } + } + list.addAll(tmpList); + Map palMap = new HashMap(); List removeList = new ArrayList(); for (PALRepositoryModel obj : list) {