diff --git a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar index 2a0d64b0..62eafc33 100644 Binary files a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar and b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar differ diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ImportProcessExcel.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ImportProcessExcel.java index 2df169de..b281ec12 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ImportProcessExcel.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ImportProcessExcel.java @@ -15,6 +15,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.Design 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.util.CoeProcessLevelUtil; +import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil; import com.actionsoft.apps.coe.pal.yili.log.datamigration.log.Cache.LogRealTimeCountCache; import com.actionsoft.apps.coe.pal.yili.log.datamigration.log.Model.LogRealTimeCountModel; import com.actionsoft.bpms.commons.security.logging.model.Level; @@ -80,7 +81,7 @@ public class ImportProcessExcel { LogUtil.appendLog("PAL批量导入模型清单 Begin " + UtilDate.datetimeFormat(startDate), simpleLogFile, fullLogFile); LogUtil.appendLog("--------------------------------", simpleLogFile, fullLogFile); - LogUtil.appendLog("若模型(流程、表单、制度等各类模型)存在多版本,只与模型最新版本进行匹配,过往版本忽略不进行任何处理,若最新版本模型非可编辑状态(已发布、已停用、审批中),直接跳过该模型,不做任何调整", simpleLogFile, fullLogFile); + LogUtil.appendLog("若模型(流程、表单、制度等各类模型)存在多版本,只与模型当前使用中版本进行匹配,其他版本忽略不进行任何处理,若当前使用中版本模型非可编辑状态(已发布、已停用、审批中),直接跳过该模型,不做任何调整", simpleLogFile, fullLogFile); String wsId = object.getString("wsId"); JSONObject data = object.getJSONObject("data"); @@ -675,7 +676,7 @@ public class ImportProcessExcel { } else {// 更新 String namePath = getFileNamePath(palModel); - LogUtil.appendLog(BatchConst.LOG_START + "[执行阶段][更新模型阶段]更新模型" + I18nRes.findValue(CoEConstant.APP_ID, palModel.getMethodId()) + "[" + palModel.getName() + "]模型,模型ID[" + palModel.getId() + "]", simpleLogFile, fullLogFile); + LogUtil.appendLog(BatchConst.LOG_START + "[执行阶段][更新模型阶段]更新模型" + I18nRes.findValue(CoEConstant.APP_ID, palModel.getMethodId()) + "[" + palModel.getName() + "][" + VersionUtil.getVersionStrV(palModel.getVersion()) + "]模型,模型ID[" + palModel.getId() + "]", simpleLogFile, fullLogFile); LogUtil.appendLog(BatchConst.LOG_DESC + "模型所属路径[" + namePath + "]", simpleLogFile, fullLogFile); @@ -888,11 +889,11 @@ public class ImportProcessExcel { } private List assemblePalData(String wsId, String methodCategory) { - // 获取指定根目录下所有的最新版本模型列表 - List recentVerList = ProcessUtil.getRecentRepositoryList(wsId, methodCategory); + // 获取指定根目录下所有的使用中版本模型列表 + List useVerList = ProcessUtil.getUseRepositoryList(wsId, methodCategory); // 拼接数据 List list = new ArrayList(); - for (PALRepositoryModel model : recentVerList) { + for (PALRepositoryModel model : useVerList) { JSONObject tmp = new JSONObject(); tmp.put("id", model.getId()); tmp.put("name", model.getName()); diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ProcessUtil.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ProcessUtil.java index 8b0611eb..b11bcba5 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ProcessUtil.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ProcessUtil.java @@ -302,6 +302,30 @@ public class ProcessUtil { return null; } + /** + * 获取指定根目录下所有的使用中版本模型列表 + * @param wsId + * @param category 根节点分类,如process,data,org等 + * @return + */ + public static List getUseRepositoryList(String wsId, String category) { + List list = new ArrayList<>(); + Set ids = new HashSet<>(); + PALRepositoryCache.getAllChildrenModelsByPid(wsId, category, list, ids); + // 找到使用中版本,只匹配使用中版本(在日志中添加此明显提示 todo) + List useVerList = new ArrayList<>(); + Map modelMap = new HashMap<>(); + for (PALRepositoryModel model : list) { + if (model.isUse()) { + modelMap.put(model.getVersionId(), model); + } + } + for (Map.Entry entry : modelMap.entrySet()) { + useVerList.add(entry.getValue()); + } + return useVerList; + } + /** * 获取指定根目录下所有的最新版本模型列表 * @param wsId diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ValidProcessExcel.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ValidProcessExcel.java index 7939cfc6..c533de89 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ValidProcessExcel.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/process/ValidProcessExcel.java @@ -157,10 +157,10 @@ public class ValidProcessExcel { } // 3.校验在pal中是否存在并整合到目录框架 - // 获取指定根目录下所有的最新版本模型列表 - List recentVerList = ProcessUtil.getRecentRepositoryList(wsId, methodCategory); + // 获取指定根目录下所有的使用中版本模型列表 + List useVerList = ProcessUtil.getUseRepositoryList(wsId, methodCategory); // 模型进行转换 - List batchModelList = ProcessUtil.palRepository2RepositoryInfoList(recentVerList, methodCategory); + List batchModelList = ProcessUtil.palRepository2RepositoryInfoList(useVerList, methodCategory); // 查找重复的 for (RepositoryInfoModel infoModel : batchModelList) {