This commit is contained in:
zhal 2022-07-01 13:20:04 +08:00
commit 720042a4fe
2 changed files with 24 additions and 0 deletions

View File

@ -347,11 +347,20 @@ public class DataMigrationWeb extends ActionWeb {
printMsg("流程模型" + palModel.getName() + "无任何角色模型,忽略角色与岗位导入");
return null;
}
Set<String> noneRelationRole = new HashSet<>();
// 创建角色与形状关联关系
// 获取当前aris模型内的所有角色list
List<CxnOccModel> roleCxnOccModels = new ArrayList<>();
for (ObjOccModel roleOccModel : roleObjOccModels) {
List<CxnOccModel> list = cxnOccMap.get(roleOccModel.getId());
// list为null该角色在该模型中没有连接任何的活动忽略导入该角色
if (list == null) {
printMsg("流程模型" + palModel.getName() + "检测到角色" + objDefMap.get(roleOccModel.getDefId()).getName() + "尚未连接到任何活动上,忽略该角色");
noneRelationRole.add(objDefMap.get(roleOccModel.getDefId()).getName());
continue;
}
for (CxnOccModel cxnOccModel : list) {
if (cxnOccModel.getModelId().equals(arisModel.getId())) {
roleCxnOccModels.add(cxnOccModel);
@ -378,6 +387,12 @@ public class DataMigrationWeb extends ActionWeb {
}
repeatRoleMap.get(roleName).add(occModel.getId());
}
// 没有关联活动的角色也加入到角色图中
for (String roleName : noneRelationRole) {
if (!repeatRoleMap.containsKey(roleName)) {
repeatRoleMap.put(roleName, new HashSet<>());
}
}
// 创建角色图的名称与PAL角色图形状ID对应关系
Map<String, String> roleNamePalIdMap = new HashMap<>();
@ -1281,6 +1296,15 @@ public class DataMigrationWeb extends ActionWeb {
}
}
// 删除没有与活动进行连线相连的角色形状角色图中已包含该角色图标
for (String key : elements.keySet()) {
JSONObject tempShapeObj = elements.getJSONObject(key);
if ("role".equals(tempShapeObj.getString("name")) && !removeKey.contains(tempShapeObj.getString("id"))) {
removeKey.add(key);
printMsg("流程" + arisModel.getName() + "删除角色形状" + tempShapeObj.getString("text") + ",该角色无连线连接到活动");
}
}
// 保存关联关系
if (relationList.size() > 0) {
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();