Aris流程迁移IT系统属性问题处理
This commit is contained in:
parent
1e3ab9da10
commit
dae3b29c4e
Binary file not shown.
@ -88,7 +88,7 @@ public class ModelMappingAPIManager {
|
|||||||
objDefMappingMap.put("OT_POS-ST_POS",o10);
|
objDefMappingMap.put("OT_POS-ST_POS",o10);
|
||||||
}
|
}
|
||||||
if (PALMethodCache.getPALMethodModelById("itsystem.normal") != null) {
|
if (PALMethodCache.getPALMethodModelById("itsystem.normal") != null) {
|
||||||
// 岗位
|
// IT系统
|
||||||
ObjDefMappingModel o11 = new ObjDefMappingModel("OT_APPL_SYS_TYPE","ST_APPL_SYS_TYPE","appSystem","itsystem.normal",null,"shape");
|
ObjDefMappingModel o11 = new ObjDefMappingModel("OT_APPL_SYS_TYPE","ST_APPL_SYS_TYPE","appSystem","itsystem.normal",null,"shape");
|
||||||
objDefMappingMap.put("OT_APPL_SYS_TYPE-ST_APPL_SYS_TYPE",o11);
|
objDefMappingMap.put("OT_APPL_SYS_TYPE-ST_APPL_SYS_TYPE",o11);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,10 +8,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class CxnOccModel {
|
public class CxnOccModel {
|
||||||
|
|
||||||
private String id;// CxnOcc.ID
|
private String id;// ObjOcc.ID
|
||||||
private String toId;// ToObjOcc.IdRef
|
private String toId;// ToObjOcc.IdRef
|
||||||
private String objDefId;// 连线起始端形状定义ID
|
|
||||||
private String toObjDefId;// 连线终点形状定义ID
|
|
||||||
private List<PositionModel> positionList;// 连线起始端+折点
|
private List<PositionModel> positionList;// 连线起始端+折点
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@ -30,22 +28,6 @@ public class CxnOccModel {
|
|||||||
this.toId = toId;
|
this.toId = toId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getObjDefId() {
|
|
||||||
return objDefId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setObjDefId(String objDefId) {
|
|
||||||
this.objDefId = objDefId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getToObjDefId() {
|
|
||||||
return toObjDefId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToObjDefId(String toObjDefId) {
|
|
||||||
this.toObjDefId = toObjDefId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PositionModel> getPositionList() {
|
public List<PositionModel> getPositionList() {
|
||||||
return positionList;
|
return positionList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,10 +7,7 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对Aris文件进行解析、清洗
|
* 对Aris文件进行解析、清洗
|
||||||
@ -29,6 +26,8 @@ public class ArisXmlHandleWeb {
|
|||||||
|
|
||||||
public Map<String, List<CxnOccModel>> cxnOccMap = new HashMap<>();// 所有模型中所有连线map记录
|
public Map<String, List<CxnOccModel>> cxnOccMap = new HashMap<>();// 所有模型中所有连线map记录
|
||||||
|
|
||||||
|
public Map<String, Set<String>> objDefLinkerMap = new HashMap<>();// 记录所有定义形状的连线map记录
|
||||||
|
|
||||||
|
|
||||||
// 连线 todo
|
// 连线 todo
|
||||||
|
|
||||||
@ -42,7 +41,34 @@ public class ArisXmlHandleWeb {
|
|||||||
getNodes(root, groupPath);
|
getNodes(root, groupPath);
|
||||||
// 整合Model路径
|
// 整合Model路径
|
||||||
calculateModelPath();
|
calculateModelPath();
|
||||||
test();
|
// 计算定义形状之间的连线
|
||||||
|
calculateObjDefLinker();
|
||||||
|
// test();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算定义形状与定义形状之间的所有连线
|
||||||
|
*/
|
||||||
|
private void calculateObjDefLinker() {
|
||||||
|
// 获取所有定义形状
|
||||||
|
for (Map.Entry<String, ObjDefModel> entry: objDefMap.entrySet()) {
|
||||||
|
if (!objDefLinkerMap.containsKey(entry.getKey())) {
|
||||||
|
objDefLinkerMap.put(entry.getKey(), new HashSet<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 定义形状连线设置
|
||||||
|
for (Map.Entry<String, List<CxnOccModel>> entry : cxnOccMap.entrySet()) {
|
||||||
|
String fromOccId = entry.getKey();
|
||||||
|
ObjOccModel fromObjOccModel = objOccMap.get(fromOccId);
|
||||||
|
List<CxnOccModel> list = entry.getValue();
|
||||||
|
if (list != null) {
|
||||||
|
for (CxnOccModel c: list) {
|
||||||
|
String toObjOccId = c.getToId();
|
||||||
|
ObjOccModel toObjOccModel = objOccMap.get(toObjOccId);
|
||||||
|
objDefLinkerMap.get(fromObjOccModel.getDefId()).add(toObjOccModel.getDefId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculateModelPath() {
|
private void calculateModelPath() {
|
||||||
@ -266,28 +292,38 @@ public class ArisXmlHandleWeb {
|
|||||||
if (list != null) {
|
if (list != null) {
|
||||||
System.out.println("模型内形状信息:");
|
System.out.println("模型内形状信息:");
|
||||||
for (ObjOccModel objOccModel : list) {
|
for (ObjOccModel objOccModel : list) {
|
||||||
// System.out.println("模型内的形状信息:" + objDefMap.get(objOccModel.getDefId()).getName());
|
System.out.println("模型内的形状信息:" + objDefMap.get(objOccModel.getDefId()).getName());
|
||||||
|
System.out.println("该形状定义信息的下一个连线定义形状:");
|
||||||
|
Set<String> set = objDefLinkerMap.get(objOccModel.getDefId());
|
||||||
|
if (set.size() == 0) {
|
||||||
|
System.out.println("无");
|
||||||
|
} else {
|
||||||
|
for (String defId : set) {
|
||||||
|
System.out.println(objDefMap.get(defId).getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("-------------");
|
||||||
// System.out.print(objDefMap.get(objOccModel.getDefId()).getName() + " ");
|
// System.out.print(objDefMap.get(objOccModel.getDefId()).getName() + " ");
|
||||||
// System.out.println(objDefMap.get(objOccModel.getDefId()).getAttrData());
|
// System.out.println(objDefMap.get(objOccModel.getDefId()).getAttrData());
|
||||||
// System.out.println(objOccModel);
|
// System.out.println(objOccModel);
|
||||||
// System.out.println("该形状定义信息");
|
// System.out.println("该形状定义信息");
|
||||||
// System.out.println(objDefMap.get(objOccModel.getDefId()));
|
// System.out.println(objDefMap.get(objOccModel.getDefId()));
|
||||||
}
|
}
|
||||||
System.out.println();
|
// System.out.println();
|
||||||
// 获取模型内所有连线
|
// // 获取模型内所有连线
|
||||||
for (ObjOccModel occ: list) {
|
// for (ObjOccModel occ: list) {
|
||||||
if (cxnOccMap.containsKey(occ.getId())) {
|
// if (cxnOccMap.containsKey(occ.getId())) {
|
||||||
List<CxnOccModel> cxnOccModels = cxnOccMap.get(occ.getId());
|
// List<CxnOccModel> cxnOccModels = cxnOccMap.get(occ.getId());
|
||||||
for (CxnOccModel cxn: cxnOccModels) {
|
// for (CxnOccModel cxn: cxnOccModels) {
|
||||||
ObjOccModel idObj = objOccMap.get(cxn.getId());
|
// ObjOccModel idObj = objOccMap.get(cxn.getId());
|
||||||
ObjOccModel toIdObj = objOccMap.get(cxn.getToId());
|
// ObjOccModel toIdObj = objOccMap.get(cxn.getToId());
|
||||||
System.out.println(
|
// System.out.println(
|
||||||
objDefMap.get(idObj.getDefId()).getName() + " 的下一个形状是 " + objDefMap.get(toIdObj.getDefId()).getName()
|
// objDefMap.get(idObj.getDefId()).getName() + " 的下一个形状是 " + objDefMap.get(toIdObj.getDefId()).getName()
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}else {
|
}else {
|
||||||
System.out.println("当前流程【"+modelModel.getName()+"】下没有图形 流程的ARIS路径为 "+modelModel.getModelPath());
|
System.out.println("当前流程【"+modelModel.getName()+"】下没有图形 流程的ARIS路径为 "+modelModel.getModelPath());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,9 +13,9 @@ import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
|||||||
import com.actionsoft.apps.coe.pal.datamigration.util.WordUtil;
|
import com.actionsoft.apps.coe.pal.datamigration.util.WordUtil;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
|
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
||||||
@ -178,8 +178,8 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
// String fileName = "xmlexport.xml";
|
// String fileName = "xmlexport.xml";
|
||||||
// 读取xml文件
|
// 读取xml文件
|
||||||
Document d = XMLUtil.readXML(file.getPath(), true);
|
Document d = XMLUtil.readXML(file.getPath(), true);
|
||||||
// String toFilePath = "/Users/actionsoft/Documents/workspace/IDEA/yili/apps/com.actionsoft.apps.coe.pal.datamigration/testFile/targetFile/";
|
// String toFilePath = "/Users/sunlh/Documents/ideaData/actionsoft/aws6.4.1.1008.yili2/apps/com.actionsoft.apps.coe.pal.datamigration/testFile/targetFile/";
|
||||||
// XMLUtil.writeXml(d, toFilePath + fileName);
|
// XMLUtil.writeXml(d, toFilePath + fileName);
|
||||||
// 解析xml文件
|
// 解析xml文件
|
||||||
if (d == null) {
|
if (d == null) {
|
||||||
return ResponseObject.newErrResponse().toString();
|
return ResponseObject.newErrResponse().toString();
|
||||||
@ -200,8 +200,27 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
|
|
||||||
Map<String, List<CxnOccModel>> cxnOccMap = handleWeb.cxnOccMap;// 形状连线记录
|
Map<String, List<CxnOccModel>> cxnOccMap = handleWeb.cxnOccMap;// 形状连线记录
|
||||||
|
|
||||||
|
Map<String, Set<String>> objDefLinkerMap = handleWeb.objDefLinkerMap;// 记录所有定义形状的连线map记录
|
||||||
|
|
||||||
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();// 属性存储
|
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();// 属性存储
|
||||||
|
|
||||||
|
// 获取所有IT系统图,并查询所有IT系统形状
|
||||||
|
Map<String, JSONObject> itShapeMap = new HashMap<>();
|
||||||
|
Set<String> ids = new HashSet<>();
|
||||||
|
List<PALRepositoryModel> itModels = new ArrayList<>();
|
||||||
|
PALRepositoryCache.getAllChildrenModelsByPid(wsId, "itsystem", itModels, ids);
|
||||||
|
for (PALRepositoryModel itModel : itModels) {
|
||||||
|
String definition = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(null, itModel.getId());
|
||||||
|
List<JSONObject> list = com.actionsoft.apps.coe.pal.pal.repository.designer.util.ShapeUtil.getShapeJsonToJsonObject(definition);
|
||||||
|
for (JSONObject shape: list) {
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
obj.put("shapeId", shape.getString("id"));
|
||||||
|
obj.put("plId", itModel.getId());
|
||||||
|
obj.put("shapeName", shape.getString("text"));
|
||||||
|
itShapeMap.put(shape.getString("text"), obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 存储匹配到与未匹配到的模型信息
|
// 存储匹配到与未匹配到的模型信息
|
||||||
List<ModelModel> matchModels = new ArrayList<>();
|
List<ModelModel> matchModels = new ArrayList<>();
|
||||||
List<ModelModel> unMatchModels = new ArrayList<>();
|
List<ModelModel> unMatchModels = new ArrayList<>();
|
||||||
@ -278,7 +297,6 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
// 创建形状和连线
|
// 创建形状和连线
|
||||||
JSONObject newElements = createShapeElement(wsId, currentModelNoShape, idRelationMap, roleShapeIdRelationMap, palModel, arisModel, modelObjOccMap, objDefMap, objOccMap, cxnOccMap);
|
JSONObject newElements = createShapeElement(wsId, currentModelNoShape, idRelationMap, roleShapeIdRelationMap, palModel, arisModel, modelObjOccMap, objDefMap, objOccMap, cxnOccMap);
|
||||||
|
|
||||||
System.out.println("111");
|
|
||||||
if (newElements == null) continue;
|
if (newElements == null) continue;
|
||||||
|
|
||||||
// 处理输入输出活动属性
|
// 处理输入输出活动属性
|
||||||
@ -288,7 +306,7 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
this.handleProcessAttrRoleRelation(wsId, palModel.getId(), roleShapeIdRelationMap, newElements, arisModel, modelObjOccMap, objDefMap);
|
this.handleProcessAttrRoleRelation(wsId, palModel.getId(), roleShapeIdRelationMap, newElements, arisModel, modelObjOccMap, objDefMap);
|
||||||
|
|
||||||
// 处理流程关联属性IT系统
|
// 处理流程关联属性IT系统
|
||||||
this.handleProcessAttrItSystemRelation(wsId, idRelationMap, palModel.getId(), newElements, arisModel, modelObjOccMap, objDefMap);
|
this.handleProcessAttrItSystemRelation(wsId, idRelationMap, palModel.getId(), newElements, arisModel, modelObjOccMap, objDefMap, objDefLinkerMap, itShapeMap);
|
||||||
|
|
||||||
this.handleProcessAttrLeadOrRearProcess(wsId, currentModelNoShape, idRelationMap, palModel.getId(), newElements, arisModel, modelObjOccMap, objDefMap);
|
this.handleProcessAttrLeadOrRearProcess(wsId, currentModelNoShape, idRelationMap, palModel.getId(), newElements, arisModel, modelObjOccMap, objDefMap);
|
||||||
|
|
||||||
@ -437,9 +455,10 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验一些必备的建模属性
|
* 校验一些必备的建模属性
|
||||||
*
|
|
||||||
* @param wsId
|
* @param wsId
|
||||||
* @param mappingKey
|
* @param shapeMethodId
|
||||||
|
* @param shapeMethodName
|
||||||
|
* @param methodId
|
||||||
* @param categoryName
|
* @param categoryName
|
||||||
* @param methodName
|
* @param methodName
|
||||||
* @param methodCode
|
* @param methodCode
|
||||||
@ -927,7 +946,6 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理流程关联属性IT系统
|
* 处理流程关联属性IT系统
|
||||||
*
|
|
||||||
* @param wsId
|
* @param wsId
|
||||||
* @param idRelationMap
|
* @param idRelationMap
|
||||||
* @param repositoryModelId
|
* @param repositoryModelId
|
||||||
@ -935,125 +953,55 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
* @param arisModel
|
* @param arisModel
|
||||||
* @param modelObjOccMap
|
* @param modelObjOccMap
|
||||||
* @param objDefMap
|
* @param objDefMap
|
||||||
|
* @param objDefLinkerMap
|
||||||
|
* @param itShapeMap
|
||||||
*/
|
*/
|
||||||
private void handleProcessAttrItSystemRelation(String wsId, Map<String, String> idRelationMap, String repositoryModelId, JSONObject elements, ModelModel arisModel,
|
private void handleProcessAttrItSystemRelation(String wsId, Map<String, String> idRelationMap, String repositoryModelId, JSONObject elements, ModelModel arisModel,
|
||||||
Map<String, List<ObjOccModel>> modelObjOccMap,
|
Map<String, List<ObjOccModel>> modelObjOccMap,
|
||||||
Map<String, ObjDefModel> objDefMap) {
|
Map<String, ObjDefModel> objDefMap, Map<String, Set<String>> objDefLinkerMap, Map<String, JSONObject> itShapeMap) {
|
||||||
// 获取ARIS图形定义与PAL图形定义关系
|
// 获取ARIS图形定义与PAL图形定义关系
|
||||||
Map<String, ObjDefMappingModel> objDefMappingMap = ModelMappingAPIManager.getInstance().getObjDefMappingMap();
|
Map<String, ObjDefMappingModel> objDefMappingMap = ModelMappingAPIManager.getInstance().getObjDefMappingMap();
|
||||||
ObjDefMappingModel objDefMappingModel = objDefMappingMap.get("OT_APPL_SYS_TYPE-ST_APPL_SYS_TYPE");
|
ObjDefMappingModel objDefMappingModel = objDefMappingMap.get("OT_APPL_SYS_TYPE-ST_APPL_SYS_TYPE");
|
||||||
// 获取当前ARIS模型下所有的图形信息
|
// 获取当前ARIS模型下所有的图形信息
|
||||||
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
||||||
// 存放待删除图形的KEY
|
Map<String, Set<String>> shapeRelationItMap = new HashMap<>();// 记录PAL形状关联的IT系统文本
|
||||||
List<String> removeKey = new ArrayList<>();
|
for (ObjOccModel objOccModel: objOccModels) {
|
||||||
// 流程关联属性结果集
|
String objDefId = objOccModel.getDefId();
|
||||||
|
System.out.println(objDefMap.get(objDefId).getName());
|
||||||
|
// 获取定义形状通过连线进行连接的所有定义形状
|
||||||
|
Set<String> toObjDefIds = objDefLinkerMap.get(objDefId);
|
||||||
|
if (toObjDefIds == null || toObjDefIds.size() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 取出所有IT系统
|
||||||
|
Set<String> shapeRelationItObjDefNames = new HashSet<>();// 记录当前形状的IT系统(s)
|
||||||
|
for (String toObjDefId: toObjDefIds) {
|
||||||
|
ObjDefModel objDefModel = objDefMap.get(toObjDefId);
|
||||||
|
if (objDefModel.getSymbolNum().equals(objDefMappingModel.getSymbolNum()) && objDefModel.getTypeNum().equals(objDefMappingModel.getTypeNum())) {
|
||||||
|
// 是IT系统
|
||||||
|
shapeRelationItObjDefNames.add(objDefModel.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shapeRelationItObjDefNames.size() > 0) {
|
||||||
|
shapeRelationItMap.put(idRelationMap.get(objOccModel.getId()), shapeRelationItObjDefNames);
|
||||||
|
}
|
||||||
|
}
|
||||||
List<DesignerShapeRelationModel> relationList = new ArrayList<>();
|
List<DesignerShapeRelationModel> relationList = new ArrayList<>();
|
||||||
for (ObjOccModel objOccModel : objOccModels) {
|
for (Map.Entry<String, Set<String>> entry: shapeRelationItMap.entrySet()) {
|
||||||
ObjDefModel objDefModel = objDefMap.get(objOccModel.getDefId());// 形状定义
|
String shapeId = entry.getKey();
|
||||||
// 根据ARIS图形定义信息判断当前模型下的所有形状里是否有系统形状
|
Set<String> itShapeNames = entry.getValue();
|
||||||
if (objDefModel.getTypeNum().equals(objDefMappingModel.getTypeNum()) && objDefModel.getSymbolNum().equals(objDefMappingModel.getSymbolNum())) {
|
for (String itShapeName: itShapeNames) {
|
||||||
// 如果有输入输出形状 取出关联的PAL模型ID
|
if (itShapeMap.containsKey(itShapeName)) {
|
||||||
String shapeId = idRelationMap.get(objOccModel.getId());
|
DesignerShapeRelationModel m = new DesignerShapeRelationModel();
|
||||||
JSONObject itSystemObj = elements.getJSONObject(shapeId);
|
m.setId(UUIDGener.getUUID());
|
||||||
// 根据当前关联的系统图内容与已经导入进的系统图的内容去匹配 如果没有匹配上 暂时不处理【暂定】
|
m.setFileId(repositoryModelId);
|
||||||
// 【需求变动--暂作文本处理】
|
m.setShapeId(shapeId);
|
||||||
// String itSysShapeRelationId = "";
|
m.setShapeText(elements.getJSONObject(shapeId).getString("text"));
|
||||||
// String itSysRepositoryRelationId = "";
|
m.setRelationFileId(itShapeMap.get(itShapeName).getString("plId"));
|
||||||
// List<PALRepositoryModel> repositoryModels = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryModelsByWsIdAndMethodId(wsId, "itsystem.normal");
|
m.setRelationShapeId(itShapeMap.get(itShapeName).getString("shapeId"));
|
||||||
// for (PALRepositoryModel model : repositoryModels){
|
m.setRelationShapeText(itShapeMap.get(itShapeName).getString("shapeName"));
|
||||||
// BaseModel baseModel = CoeDesignerAPIManager.getInstance().getDefinition(model.getId(), 0);
|
m.setAttrId(Constant.METHOD_INFO_SYSTEM);
|
||||||
// if (baseModel == null) {
|
relationList.add(m);
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// String define = baseModel.getDefinition();
|
|
||||||
// JSONObject definition = JSONObject.parseObject(define);
|
|
||||||
// JSONObject ele = definition.getJSONObject("elements");
|
|
||||||
// for (String key : ele.keySet()) {
|
|
||||||
// JSONObject shapeObj = elements.getJSONObject(key);
|
|
||||||
// if (shapeObj.getString("text").equals(itSystemObj.getString("text"))) {
|
|
||||||
// itSysShapeRelationId = key;
|
|
||||||
// itSysRepositoryRelationId = model.getId();
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (UtilString.isNotEmpty(itSysShapeRelationId)) {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
for (String key : elements.keySet()) {
|
|
||||||
JSONObject shapeObj = elements.getJSONObject(key);
|
|
||||||
if ("linker".equals(shapeObj.getString("name"))) {
|
|
||||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance()
|
|
||||||
.getValidAttributeModels(wsId, "process.epc", "process", "process.epc");
|
|
||||||
attributeModels = attributeModels.stream().filter(item -> Constant.METHOD_INFO_SYSTEM.equals(item.getKey())).collect(Collectors.toList());
|
|
||||||
PALMethodAttributeModel attributeModel = attributeModels.get(0);
|
|
||||||
String relationedShapeId = "";
|
|
||||||
if (shapeObj.getJSONObject("from").getString("id").equals(shapeId)) {
|
|
||||||
relationedShapeId = shapeObj.getJSONObject("to").getString("id");
|
|
||||||
} else if (shapeObj.getJSONObject("to").getString("id").equals(shapeId)) {
|
|
||||||
relationedShapeId = shapeObj.getJSONObject("from").getString("id");
|
|
||||||
}
|
|
||||||
if (UtilString.isEmpty(relationedShapeId)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 将转化后的信息放到相应位置
|
|
||||||
// DesignerShapeRelationModel relationModel = new DesignerShapeRelationModel();
|
|
||||||
// relationModel.setFileId(repositoryModelId);
|
|
||||||
// relationModel.setAttrId(attributeModel.getKey());
|
|
||||||
// relationModel.setId(UUIDGener.getUUID());
|
|
||||||
// relationModel.setShapeId(relationedShapeId);
|
|
||||||
// relationModel.setShapeText(elements.getJSONObject(relationedShapeId).getString("text"));
|
|
||||||
// relationModel.setRelationFileId(itSysRepositoryRelationId);
|
|
||||||
// relationModel.setRelationShapeId(itSysShapeRelationId);
|
|
||||||
// relationModel.setRelationShapeText(itSystemObj.getString("text"));
|
|
||||||
// relationList.add(relationModel);
|
|
||||||
JSONArray dataAttributes = elements.getJSONObject(relationedShapeId).getJSONArray("dataAttributes");
|
|
||||||
if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) {
|
|
||||||
JSONObject tempRelationObj = new JSONObject();
|
|
||||||
tempRelationObj.put("value", itSystemObj.getString("text"));
|
|
||||||
tempRelationObj.put("key", attributeModel.getKey());
|
|
||||||
tempRelationObj.put("isRequired", attributeModel.getIsRequired());
|
|
||||||
tempRelationObj.put("ref", attributeModel.getRef());
|
|
||||||
tempRelationObj.put("readonly", attributeModel.getReadonly());
|
|
||||||
tempRelationObj.put("scope", attributeModel.getScope());
|
|
||||||
tempRelationObj.put("name", attributeModel.getTitle());
|
|
||||||
tempRelationObj.put("id", attributeModel.getKey());
|
|
||||||
tempRelationObj.put("type", attributeModel.getType());
|
|
||||||
tempRelationObj.put("groupPath", attributeModel.getGroupPath());
|
|
||||||
tempRelationObj.put("desc", attributeModel.getDesc());
|
|
||||||
for (Object attribute : dataAttributes) {
|
|
||||||
JSONObject obj = (JSONObject) attribute;
|
|
||||||
if (obj.containsKey("attributesJsonArray")) {
|
|
||||||
JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray");
|
|
||||||
JSONArray tempJSONArr = attributesJsonArray.stream()
|
|
||||||
.filter(item -> ((JSONObject) item).getString("key").equals(attributeModel.getKey()))
|
|
||||||
.collect(Collectors.toCollection(JSONArray::new));
|
|
||||||
if (tempJSONArr.size() > 0) {
|
|
||||||
for (Object o : attributesJsonArray) {
|
|
||||||
if (attributeModel.getKey().equals(((JSONObject) o).getString("key"))) {
|
|
||||||
String tempValue = new StringBuffer(((JSONObject) o).getString("value"))
|
|
||||||
.append(",").append(itSystemObj.getString("text")).toString();
|
|
||||||
((JSONObject) o).put("value", tempValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tempRelationObj.put("value", new JSONArray());
|
|
||||||
tempRelationObj.getJSONArray("value").add(tempRelationObj);
|
|
||||||
attributesJsonArray.add(tempRelationObj);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
tempRelationObj.put("value", new JSONArray());
|
|
||||||
tempRelationObj.getJSONArray("value").add(tempRelationObj);
|
|
||||||
obj.put("attributesJsonArray", new JSONArray());
|
|
||||||
obj.getJSONArray("attributesJsonArray").add(tempRelationObj);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
removeKey.add(key);
|
|
||||||
removeKey.add(shapeId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1063,7 +1011,6 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
relationList.stream().forEach(item -> printMsg("流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联当前流程下IT系统【" + item.getRelationShapeText() + "】"));
|
relationList.stream().forEach(item -> printMsg("流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联当前流程下IT系统【" + item.getRelationShapeText() + "】"));
|
||||||
relationDao.barchInsert(relationList);
|
relationDao.barchInsert(relationList);
|
||||||
}
|
}
|
||||||
removeKey.stream().forEach(key -> elements.remove(key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1637,7 +1584,7 @@ public class DataMigrationWeb extends ActionWeb {
|
|||||||
if (propertyModel.getPropertyValue().equals(modelPath)) {
|
if (propertyModel.getPropertyValue().equals(modelPath)) {
|
||||||
// printMsg("ARIS路径 "+propertyModel.getPropertyValue());
|
// printMsg("ARIS路径 "+propertyModel.getPropertyValue());
|
||||||
repositoryModel = new PALRepository().getInstance(propertyModel.getPlId());
|
repositoryModel = new PALRepository().getInstance(propertyModel.getPlId());
|
||||||
if (arisModel.getName().equals(repositoryModel.getName())) {
|
if (arisModel.getName().trim().equals(repositoryModel.getName())) {
|
||||||
printMsg("匹配到的MODEL PATH " + modelPath + "\\" + arisModel.getName());
|
printMsg("匹配到的MODEL PATH " + modelPath + "\\" + arisModel.getName());
|
||||||
flag = true;
|
flag = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user