Aris流程数据迁移日志记录处理
This commit is contained in:
parent
7d9d5ed35d
commit
13b80bf501
@ -1 +1 @@
|
||||
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME VARCHAR(100), FILLPATH VARCHAR(500), LOGPATH VARCHAR(500), CREATEUSER VARCHAR(20),CREATEUSERNAME VARCHAR(20),CREATEDATE DATETIME, STARTDATE DATETIME, ENDTIME DATETIME, RESULTSTATUS SMALLINT(1), MAININFO VARCHAR(500), EXT1 VARCHAR(64),EXT2 VARCHAR(128),EXT3 VARCHAR(255),EXT4 VARCHAR(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME VARCHAR(100), FILEPATH VARCHAR(500), LOGPATH VARCHAR(500), CREATEUSER VARCHAR(20),CREATEUSERNAME VARCHAR(20),CREATEDATE DATETIME, STARTDATE DATETIME, ENDDATE DATETIME, RESULTSTATUS SMALLINT(1), MAININFO VARCHAR(500), EXT1 VARCHAR(64),EXT2 VARCHAR(128),EXT3 VARCHAR(255),EXT4 VARCHAR(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||
@ -1 +1 @@
|
||||
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME NVARCHAR2(100), FILLPATH NVARCHAR2(500), LOGPATH NVARCHAR2(500), CREATEUSER NVARCHAR2(20),CREATEUSERNAME NVARCHAR2(20), CREATEDATE DATE, STARTDATE DATE, ENDTIME DATE, RESULTSTATUS NUMBER(1), MAININFO NVARCHAR2(500), EXT1 NVARCHAR2(64),EXT2 NVARCHAR2(128),EXT3 NVARCHAR2(255),EXT4 NVARCHAR2(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME NVARCHAR2(100), FILEPATH NVARCHAR2(500), LOGPATH NVARCHAR2(500), CREATEUSER NVARCHAR2(20),CREATEUSERNAME NVARCHAR2(20), CREATEDATE DATE, STARTDATE DATE, ENDDATE DATE, RESULTSTATUS NUMBER(1), MAININFO NVARCHAR2(500), EXT1 NVARCHAR2(64),EXT2 NVARCHAR2(128),EXT3 NVARCHAR2(255),EXT4 NVARCHAR2(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||
Binary file not shown.
@ -1,9 +1,13 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.aris.web;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.cache.DataMigrationCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.cache.LogRealTimeCountCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogRealTimeCountModel;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.ProcessUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
|
||||
@ -25,8 +29,10 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelI
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.bpms.util.UtilDate;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -49,8 +55,11 @@ public class ArisXmlImportRun {
|
||||
private File warnLogFile;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private long startTime;
|
||||
|
||||
public ArisXmlImportRun(UserContext uc, String wsId, String logId, String logPath, File simpleLogFile, File fullLogFile, File warnLogFile, String filePath, String fileName) {
|
||||
private long endTime;
|
||||
|
||||
public ArisXmlImportRun(UserContext uc, String wsId, String logId, String logPath, File simpleLogFile, File fullLogFile, File warnLogFile, String filePath, String fileName, long startTime) {
|
||||
this.uc = uc;
|
||||
this.wsId = wsId;
|
||||
this.logId = logId;
|
||||
@ -60,6 +69,7 @@ public class ArisXmlImportRun {
|
||||
this.warnLogFile = warnLogFile;
|
||||
this.filePath = filePath;
|
||||
this.fileName = fileName;
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public void execute(ArisXmlHandleWeb handleWeb) {
|
||||
@ -79,46 +89,88 @@ public class ArisXmlImportRun {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
|
||||
// 存储匹配到与未匹配到的模型信息
|
||||
List<ModelModel> matchModels = new ArrayList<>();
|
||||
List<ModelModel> unMatchModels = new ArrayList<>();
|
||||
// 存储已经匹配上但是文件里已经有内容【可能导入重复】的模型信息
|
||||
List<ModelModel> repeatModels = new ArrayList<>();
|
||||
// 存储不包含图形的流程,无任何形状的流程不进行导入
|
||||
List<ModelModel> currentModelNoShape = new ArrayList<>();
|
||||
for (Map.Entry<String, ModelModel> entry : modelMap.entrySet()) {
|
||||
ModelModel arisModel = entry.getValue();
|
||||
// 创建角色模型
|
||||
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
||||
if (objOccModels == null || objOccModels.size() == 0) {
|
||||
currentModelNoShape.add(arisModel);
|
||||
printMsg("流程" + arisModel.getName() + arisModel.getId() + "无任何模型,导入忽略");
|
||||
continue;
|
||||
try {
|
||||
// 获取所有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);
|
||||
}
|
||||
}
|
||||
// 匹配模型
|
||||
PALRepositoryModel palModel = matchPalModel(arisModel, wsId);
|
||||
if (palModel != null) {
|
||||
matchModels.add(arisModel);
|
||||
String rolefolderId = checkAndCreatePalRoleFolderModel(coeProcessLevel, wsId);// 创建/获取角色文件夹ID,作为角色的顶级文件夹
|
||||
|
||||
// 获取所有PAL EPC的模型
|
||||
Map<String, String> palArisPropValMap = getPalRepositoryXmlPathMap(wsId);
|
||||
|
||||
List<ModelModel> arisEpcModelList = new ArrayList<>();
|
||||
for (Map.Entry<String, ModelModel> entry : modelMap.entrySet()) {
|
||||
ModelModel arisModel = entry.getValue();
|
||||
if ("MT_EEPC".equals(arisModel.getType())) {
|
||||
arisEpcModelList.add(arisModel);
|
||||
}
|
||||
}
|
||||
// 按照路径排序
|
||||
arisEpcModelList.sort((a1, a2)-> {
|
||||
return a1.getModelPath().compareTo(a2.getModelPath());
|
||||
});
|
||||
|
||||
String arisRootPath = "\\伊利集团业务流程管理平台";
|
||||
int totalArisCount = LogRealTimeCountCache.getCache().get(logId).getTotalCount();
|
||||
for (int i = 0; i < arisEpcModelList.size(); i++) {
|
||||
ModelModel arisModel = arisEpcModelList.get(i);
|
||||
String arisPath = arisRootPath + arisModel.getModelPath();
|
||||
int importingCount = i + 1;// 当前是导入的第几个
|
||||
LogRealTimeCountCache.getCache().get(logId).setImportingCount(importingCount);// 当前记录缓存
|
||||
// 当前正在导入的流程全部日志记录,方便对照
|
||||
LogUtil.appendLog("-----------------【" + importingCount + "/" + totalArisCount + "】-----------------", simpleLogFile, fullLogFile, warnLogFile);
|
||||
|
||||
// 校验Aris是否空模型
|
||||
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
||||
if (objOccModels == null || objOccModels.size() == 0) {
|
||||
// 空模型当作警告处理,全部记录
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程" + "【" + arisModel.getName() + "】内容为空,导入忽略", simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogUtil.appendLog(Constant.LOG_DESC + "该流程所属路径:" + arisPath);
|
||||
LogRealTimeCountCache.getCache().get(logId).setArisBlankCount(LogRealTimeCountCache.getCache().get(logId).getArisBlankCount() + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
// PAL流程与Aris流程进行匹配
|
||||
boolean flag = false;
|
||||
PALRepositoryModel palModel = null;
|
||||
for (Map.Entry<String, String> entry : palArisPropValMap.entrySet()) {
|
||||
if (arisPath.equals(entry.getValue())) {
|
||||
String palId = entry.getKey();
|
||||
PALRepositoryModel plModel = PALRepositoryCache.getCache().get(palId);
|
||||
if (arisModel.getName().trim().equals(plModel.getName().trim())) {
|
||||
palModel = plModel;
|
||||
flag = true;
|
||||
// 匹配成功不记录到警告日志中
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "Aris流程" + "【" + arisModel.getName() + "】与PAL流程" + "【" + palModel.getName() + "】", simpleLogFile, fullLogFile);
|
||||
LogUtil.appendLog(Constant.LOG_DESC + "Aris流程所属路径:" + arisPath);
|
||||
LogUtil.appendLog(Constant.LOG_DESC + "PAL流程所属路径:" + ProcessUtil.getRepositoryPath(palModel.getId()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 未匹配成功
|
||||
if (!flag) {
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程" + "【" + arisModel.getName() + "】未匹配到PAL流程", simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogUtil.appendLog(Constant.LOG_DESC + "Aris流程所属路径:" + arisPath, simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogRealTimeCountCache.getCache().get(logId).setMatchFieldCount(LogRealTimeCountCache.getCache().get(logId).getMatchFieldCount() + 1);
|
||||
continue;
|
||||
}
|
||||
// 判断计划导入到的PAL流程是否已经存在数据
|
||||
String plId = palModel.getId();
|
||||
// 模型是否可导入
|
||||
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(plId, 0);
|
||||
@ -132,17 +184,17 @@ public class ArisXmlImportRun {
|
||||
JSONObject definition = JSONObject.parseObject(define);
|
||||
JSONObject elements = definition.getJSONObject("elements");
|
||||
if (elements != null && !elements.isEmpty()) {
|
||||
// 导入模型已存在数据,不允许导入 todo
|
||||
repeatModels.add(arisModel);
|
||||
printMsg("[" + arisModel.getName() + "] 导入流程模型已存在数据,不允许导入,对同名角色模型进行忽略处理");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "匹配到的PAL流程模型已存在数据,不允许导入,忽略", simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogRealTimeCountCache.getCache().get(logId).setPalExistsCount(LogRealTimeCountCache.getCache().get(logId).getPalExistsCount() + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
String rolefolderId = checkAndCreatePalRoleFolderModel(coeProcessLevel, wsId);// 创建/获取角色文件夹ID,作为角色的顶级文件夹
|
||||
LogUtil.appendLog(Constant.LOG_START + "导入Aris流程" + "【" + arisModel.getName() + "】", simpleLogFile, fullLogFile, warnLogFile);
|
||||
|
||||
Map<String, String> arisFunIdRelationPalRoleMap = new HashMap<>();// aris功能模型与aris角色模型的id映射,key:aris fun shape id,value:pal role id
|
||||
Map<String, String> palRoleIdRelationNameMap = new HashMap<>();// key pal role shape id ,value:pal role shape text
|
||||
// 创建角色模型和角色元素,并且获取aris角色与pal角色映射关系
|
||||
String roleMdoelId = createRoleModelAndElements(coeProcessLevel, rolefolderId, wsId, currentModelNoShape, palModel, arisModel, modelObjOccMap, objDefMap, objOccMap, cxnOccMap, objDefLinkerMap, arisFunIdRelationPalRoleMap, methodAttrsMap, palRoleIdRelationNameMap);
|
||||
String roleMdoelId = createRoleModelAndElements(coeProcessLevel, rolefolderId, wsId, palModel, arisModel, modelObjOccMap, objDefMap, objOccMap, cxnOccMap, objDefLinkerMap, arisFunIdRelationPalRoleMap, methodAttrsMap, palRoleIdRelationNameMap);
|
||||
|
||||
// 存储当前模型下ARIS图形ID与PAL图形ID映射关系
|
||||
Map<String, String> idRelationMap = new HashMap<>();
|
||||
@ -160,7 +212,8 @@ public class ArisXmlImportRun {
|
||||
// 处理流程关联属性IT系统
|
||||
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, idRelationMap, palModel.getId(), newElements, arisModel, modelObjOccMap, objDefMap);
|
||||
|
||||
// 增加其他默认的属性,值默认为空 by孙连辉 20220626
|
||||
this.handleShapeDefaultAttr(wsId, palModel, newElements, methodAttrsMap);
|
||||
@ -172,13 +225,89 @@ public class ArisXmlImportRun {
|
||||
// 保存文件
|
||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||
|
||||
} else {
|
||||
unMatchModels.add(arisModel);
|
||||
}
|
||||
}
|
||||
// 记录结束日志
|
||||
endTime = System.currentTimeMillis();
|
||||
Timestamp endDate = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
|
||||
LogRealTimeCountCache.getCache().get(logId).setSuccessCount(LogRealTimeCountCache.getCache().get(logId).getSuccessCount() + 1);
|
||||
|
||||
|
||||
LogUtil.appendLog(Constant.LOG_END + "保存PAL流程【" + palModel.getName() + "】的形状和连线", simpleLogFile, fullLogFile);
|
||||
LogUtil.appendLog(Constant.LOG_END + "导入Aris流程" + "【" + arisModel.getName() + "】", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
Timestamp endDate = new Timestamp(System.currentTimeMillis());
|
||||
LogRealTimeCountModel model = LogRealTimeCountCache.getCache().get(logId);
|
||||
String takeTimeText = takeTime(endTime, startTime);
|
||||
String resultMsg = "导入完成,总耗时【" + takeTimeText + "】,ArisXML流程总共【" + model.getTotalCount() + "】,导入成功【" + model.getSuccessCount() + "】条,导入失败【" + (model.getTotalCount() - model.getSuccessCount())
|
||||
+ "】条(PAL已存在的数据【" + model.getPalExistsCount() + "】条),Aris流程为空模型的数据【" + model.getArisBlankCount() + "】条,Aris与PAL匹配失败的数据【" + model.getMatchFieldCount() + "】条)";
|
||||
LogUtil.appendLog(Constant.LOG_END + "," + resultMsg, simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogUtil.appendLog("Aris XML流程导入 End " + UtilDate.datetimeFormat(endDate), simpleLogFile, fullLogFile, warnLogFile);
|
||||
LogUtil.appendLog("--------------------------------", simpleLogFile, fullLogFile, warnLogFile);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 记录结束日志
|
||||
endTime = System.currentTimeMillis();
|
||||
Timestamp endDate = new Timestamp(System.currentTimeMillis());
|
||||
LogRealTimeCountModel model = LogRealTimeCountCache.getCache().get(logId);
|
||||
String takeTimeText = takeTime(endTime, startTime);
|
||||
String resultMsg = "导入失败,报错信息:" + e.getMessage() + ",总耗时【" + takeTimeText + "】,导入成功【" + model.getSuccessCount() + "】条,导入失败【" + (model.getTotalCount() - model.getSuccessCount())
|
||||
+ "】条(PAL已存在的数据【" + model.getPalExistsCount() + "】条),Aris流程为空模型的数据【" + model.getArisBlankCount() + "】条,Aris与PAL匹配失败的数据【" + model.getMatchFieldCount() + "】条)";
|
||||
LogUtil.updateLog(logId, endDate, Constant.LOG_RESULT_StATUS_ERROR, resultMsg);
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "," + resultMsg, simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算使用时间
|
||||
* @param endTime
|
||||
* @param startTime
|
||||
* @return
|
||||
*/
|
||||
private String takeTime(long endTime, long startTime) {
|
||||
long time = endTime - startTime;
|
||||
String timeMsg = "";
|
||||
if (time > 1000 * 60) {
|
||||
timeMsg = "【" + (time / 1000 / 60) + "】分钟";
|
||||
} else if (time > 1000) {
|
||||
timeMsg = "【" + (time / 1000) + "】秒";
|
||||
} else {
|
||||
timeMsg = "【" + time + "】毫秒";
|
||||
}
|
||||
return timeMsg;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有epc模型,key:epc-id,value:arisUrl
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> getPalRepositoryXmlPathMap(String wsId) {
|
||||
Map<String, String> propValMap = new HashMap<>();
|
||||
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByWsId(wsId);
|
||||
List<PALRepositoryModel> list = new ArrayList<>();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
// 无多版本情况,不考虑
|
||||
PALRepositoryModel model = iterator.next();
|
||||
if (Constant.PROCESS_EPC.equals(model.getMethodId())) {
|
||||
list.add(model);
|
||||
}
|
||||
}
|
||||
PALRepositoryPropertyDao dao = new PALRepositoryPropertyDao();
|
||||
List<PALRepositoryPropertyModel> propertyModels = dao.queryByWsId(wsId);
|
||||
propertyModels = propertyModels.stream().filter(item -> Constant.METHOD_ARIS_URL.equals(item.getPropertyId())).collect(Collectors.toList());
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (PALRepositoryPropertyModel prop : propertyModels) {
|
||||
map.put(prop.getPlId(), prop.getPropertyValue());
|
||||
}
|
||||
for (PALRepositoryModel model : list) {
|
||||
if (map.containsKey(model.getId())) {
|
||||
propValMap.put(model.getId(), map.get(model.getId()));
|
||||
}
|
||||
}
|
||||
return propValMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验和创建角色模型文件夹
|
||||
@ -202,10 +331,10 @@ public class ArisXmlImportRun {
|
||||
null, null, null, null, null, -1);
|
||||
coeProcessLevel.insert(defaultModel);
|
||||
defaultModels.add(defaultModel);
|
||||
printMsg("角色模型文件夹创建成功 " + defaultModel.getId());
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "角色模型文件夹创建", simpleLogFile, fullLogFile);
|
||||
return defaultModel.getId();
|
||||
} else {
|
||||
printMsg("角色模型文件夹已存在,不再重复创建");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "角色模型文件夹已存在,不再重复创建", simpleLogFile, fullLogFile, warnLogFile);
|
||||
return defaultModels.get(0).getId();
|
||||
}
|
||||
}
|
||||
@ -218,6 +347,7 @@ public class ArisXmlImportRun {
|
||||
* @param methodAttrsMap
|
||||
*/
|
||||
private void handleShapeDefaultAttr(String wsId, PALRepositoryModel palModel, JSONObject elements, Map<String, Map<String, JSONObject>> methodAttrsMap) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "PAL" + I18nRes.findValue(CoEConstant.APP_ID, palModel.getMethodId()) + "【" + palModel.getName() + "】中形状属性按照属性配置进行属性完善", simpleLogFile, fullLogFile);
|
||||
for (String key : elements.keySet()) {
|
||||
JSONObject shape = elements.getJSONObject(key);
|
||||
if ("linker".equals(shape.getString("name"))) {
|
||||
@ -253,6 +383,7 @@ public class ArisXmlImportRun {
|
||||
for (String attrId : attrs.keySet()) {
|
||||
if (!attrIds.contains(attrId)) {
|
||||
JSONObject eleAttrObj = getDefaultAttrObj(attrs.getJSONObject(attrId));
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL" + I18nRes.findValue(CoEConstant.APP_ID, palModel.getMethodId()) + "【" + palModel.getName() + "】中形状【" + shape.getString("text") + "】完善【" + eleAttrObj.getString("name") + "】属性配置", simpleLogFile, fullLogFile);
|
||||
attributesJsonArray.add(eleAttrObj);
|
||||
}
|
||||
}
|
||||
@ -260,6 +391,7 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL" + I18nRes.findValue(CoEConstant.APP_ID, palModel.getMethodId()) + "【" + palModel.getName() + "】中形状属性按照属性配置进行属性完善", simpleLogFile, fullLogFile);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -272,6 +404,7 @@ public class ArisXmlImportRun {
|
||||
* @return
|
||||
*/
|
||||
private JSONObject createShapeElement(String wsId, Map<String, String> idRelationMap, PALRepositoryModel palModel, ModelModel arisModel, Map<String, List<ObjOccModel>> modelObjOccMap, Map<String, ObjDefModel> objDefMap, Map<String, ObjOccModel> objOccMap, Map<String, List<CxnOccModel>> cxnOccMap, Map<String, String> palShapeIdRelationArisOccIdMap) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "创建PAL流程【" + arisModel.getName() + "】相关形状", simpleLogFile, fullLogFile);
|
||||
// aris中该模型所有形状
|
||||
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
||||
int zindex = 1;
|
||||
@ -307,6 +440,12 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
|
||||
JSONObject shape = ShapeUtil.getProcessShapeDefinitionByName(shapeMethodId, shapeName);
|
||||
// 定义位置、大小
|
||||
if (shape == null) {
|
||||
// pal形状不存在,记录日志
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程" + "【 " + arisModel.getName() + " 】的形状【 " + objDefModel.getName() + " 】形状类型在PAL中缺失,忽略导入该形状", simpleLogFile, fullLogFile, warnLogFile);
|
||||
continue;
|
||||
}
|
||||
String shapeId = UUIDGener.getObjectId();
|
||||
palShapeIdRelationArisOccIdMap.put(shapeId, objOccModel.getId());
|
||||
idRelationMap.put(objOccModel.getId(), shapeId);// 记录形状aris形状id与pal形状id
|
||||
@ -315,9 +454,6 @@ public class ArisXmlImportRun {
|
||||
if (objDefModel.getAttrData().containsKey("AT_PROC_CODE")) {
|
||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAttributeModels(wsId, objDefMappingModel.getShapeMethod(), shapeName, objDefMappingModel.getShapeMethod());
|
||||
attributeModels = attributeModels.stream().filter(item -> Constant.METHOD_NUMBER.equals(item.getKey())).collect(Collectors.toList());
|
||||
if (attributeModels.size() == 0) {
|
||||
throw new AWSException("请打开建模管理应用,查看当前【过程链】建模分类下是否存在【编号/" + Constant.METHOD_NUMBER + "】建模属性");
|
||||
}
|
||||
PALMethodAttributeModel attributeModel = attributeModels.get(0);
|
||||
JSONObject attrNumberObj = new JSONObject();
|
||||
attrNumberObj.put("value", objDefModel.getAttrData().getString("AT_PROC_CODE"));
|
||||
@ -342,16 +478,13 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建PAL流程【" + palModel.getName() + "】的形状【" + shape.getString("text") + "】的编号属性内容【" + objDefModel.getAttrData().getString("AT_PROC_CODE") + "】", fullLogFile);
|
||||
}
|
||||
|
||||
|
||||
// 处理活动节点描述 --by shang
|
||||
if (objDefModel.getAttrData().containsKey("AT_DESC")) {
|
||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAttributeModels(wsId, objDefMappingModel.getShapeMethod(), "process", objDefMappingModel.getShapeMethod());
|
||||
attributeModels = attributeModels.stream().filter(item -> Constant.METHOD_DESC.equals(item.getKey())).collect(Collectors.toList());
|
||||
if (attributeModels.size() == 0) {
|
||||
throw new AWSException("请打开建模管理应用,查看当前【过程链】建模分类下是否存在【活动描述/" + Constant.METHOD_DESC + "】建模属性");
|
||||
}
|
||||
PALMethodAttributeModel attributeModel = attributeModels.get(0);
|
||||
JSONObject attrDescObj = new JSONObject();
|
||||
attrDescObj.put("value", objDefModel.getAttrData().getString("AT_DESC"));
|
||||
@ -371,9 +504,6 @@ public class ArisXmlImportRun {
|
||||
for (Object attribute : dataAttributes) {
|
||||
JSONObject obj = (JSONObject) attribute;
|
||||
if (obj.containsKey("attributesJsonArray")) {
|
||||
|
||||
// 处理图形上默认勾选的属性,没有值的属性置空 --by shang
|
||||
// List<PALMethodAttributeModel> allValidAndUseShapeAttributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidAndUseShapeAttributeModels(wsId, objDefMappingModel.getShapeMethod());
|
||||
List<PALMethodAttributeModel> usedAttributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(wsId, objDefMappingModel.getShapeMethod(), shapeName, objDefMappingModel.getShapeMethod());
|
||||
usedAttributeModels.forEach(item -> {
|
||||
attrDescObj.put("id", item.getKey());
|
||||
@ -385,19 +515,14 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_START + "创建PAL流程【" + palModel.getName() + "】的形状【" + shape.getString("text") + "】的描述属性内容【" + objDefModel.getAttrData().getString("AT_DESC") + "】", fullLogFile);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 定义位置、大小
|
||||
if (shape == null) {
|
||||
// pal形状不存在,记录日志 todo
|
||||
printMsg("pal没有对应形状定义");
|
||||
continue;
|
||||
}
|
||||
if (shape.containsKey("attribute") && shape.getJSONObject("attribute").containsKey("editable") && !shape.getJSONObject("attribute").getBooleanValue("editable")) {// 不可编辑名称
|
||||
|
||||
} else {// 重命名名称
|
||||
String name = objDefMap.get(objOccModel.getDefId()).getName();// 形状名称
|
||||
String name = objDefModel.getName();// 形状名称
|
||||
shape.put("text", name);
|
||||
}
|
||||
|
||||
@ -408,11 +533,10 @@ public class ArisXmlImportRun {
|
||||
props.put("w", objOccModel.getW());
|
||||
props.put("h", objOccModel.getH());
|
||||
elements.put(shapeId, shape);
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建PAL流程" + "【 " + palModel.getName() + " 】的形状【 " + shape.getString("text") + " 】", fullLogFile);
|
||||
} else {
|
||||
// pal缺少对应的形状
|
||||
printMsg("pal缺少对应的形状:" + objDefModel.getName());
|
||||
System.out.println(objDefModel.getTypeNum() + "-" + objDefModel.getSymbolNum());
|
||||
System.out.println(objDefMappingMap.containsKey(objDefModel.getTypeNum() + "-" + objDefModel.getSymbolNum()));
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程" + "【 " + arisModel.getName() + " 】的形状【" + objDefModel.getName() + "】在PAL中缺失,忽略导入该形状", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
// 形状连线处理
|
||||
@ -442,12 +566,17 @@ public class ArisXmlImportRun {
|
||||
to.put("y", positionModels.get(positionModels.size() - 1).getY());
|
||||
linkerObj.put("to", to);
|
||||
elements.put(linkerId, linkerObj);
|
||||
String fromName = UtilString.isEmpty(elements.getJSONObject(from.getString("id")).getString("text")) ? elements.getJSONObject(from.getString("id")).getString("title") : elements.getJSONObject(from.getString("id")).getString("text");
|
||||
String toName = UtilString.isEmpty(elements.getJSONObject(to.getString("id")).getString("text")) ? elements.getJSONObject(to.getString("id")).getString("title") : elements.getJSONObject(to.getString("id")).getString("text");
|
||||
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建PAL流程" + "【 " + arisModel.getName() + " 】的形状连线,从【 " + fromName + " 】到【 " + toName + " 】", fullLogFile);
|
||||
} else {
|
||||
// 不包含的连线
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建PAL流程【" + arisModel.getName() + "】相关形状/连线", simpleLogFile, fullLogFile);
|
||||
return elements;
|
||||
}
|
||||
|
||||
@ -455,6 +584,7 @@ public class ArisXmlImportRun {
|
||||
* 在现有输出的图形结构上转化输入 输出活动属性,并将图上输入输出及连线删除
|
||||
*/
|
||||
private void handleShapeInputOutAttr(PALRepositoryModel palModel, JSONObject elements) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "创建PAL流程【" + palModel.getName() + "】相关形状的输入输出属性", simpleLogFile, fullLogFile);
|
||||
// 存放待删除图形的KEY
|
||||
List<String> removeKey = new ArrayList<>();
|
||||
|
||||
@ -543,7 +673,7 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
// 删除画布上的输入输出和其连线
|
||||
removeKey.stream().forEach(key -> elements.remove(key));
|
||||
|
||||
LogUtil.appendLog(Constant.LOG_END + "删除PAL流程【" + palModel.getName() + "】相关输入输出形状和其连线", simpleLogFile, fullLogFile);
|
||||
Map<String, JSONObject> attrMap = new HashMap<>();
|
||||
JSONObject attrs1 = ShapeUtil.getProcessUseShapeMethodAttrByShapeName(palModel.getWsId(), palModel.getMethodId(), palModel.getMethodId(), "method_service_node");
|
||||
attrMap.put("method_service_node", attrs1);
|
||||
@ -573,12 +703,12 @@ public class ArisXmlImportRun {
|
||||
if (obj.containsKey("attributesJsonArray")) {
|
||||
JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray");
|
||||
attributesJsonArray.add(attrObj);
|
||||
printMsg("流程" + palModel.getName() + "的节点" + shapeObj.getString("text") + "输入属性内容" + attrObj.getString("value"));
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + palModel.getName() + "】形状【" + shapeObj.getString("text") + "】的输入属性内容是【" + attrObj.getString("value") + "】", simpleLogFile, fullLogFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printMsg("流程" + palModel.getName() + "的节点" + shapeObj.getString("text") + "没有配置输入属性");
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + palModel.getName() + "】形状【" + shapeObj.getString("text") + "】没有配置输入属性,忽略输入属性赋值", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
if (shapeOutMap.containsKey(key)) {// 有输出属性
|
||||
@ -595,25 +725,25 @@ public class ArisXmlImportRun {
|
||||
if (obj.containsKey("attributesJsonArray")) {
|
||||
JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray");
|
||||
attributesJsonArray.add(attrObj);
|
||||
printMsg("流程" + palModel.getName() + "的节点" + shapeObj.getString("text") + "输出属性内容" + attrObj.getString("value"));
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + palModel.getName() + "】形状【" + shapeObj.getString("text") + "】没有配置输出属性,忽略输出属性赋值", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printMsg("流程" + palModel.getName() + "的节点" + shapeObj.getString("text") + "没有配置输出属性");
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + palModel.getName() + "】形状【" + shapeObj.getString("text") + "】没有配置输出属性,忽略输出属性赋值", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建PAL流程【" + palModel.getName() + "】相关形状的输入输出属性", simpleLogFile, fullLogFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理流程属性前后置流程
|
||||
*
|
||||
* @param wsId
|
||||
* @param currentModelNoShape
|
||||
* @param idRelationMap
|
||||
* @param repositoryModelId
|
||||
* @param elements
|
||||
@ -621,14 +751,11 @@ public class ArisXmlImportRun {
|
||||
* @param modelObjOccMap
|
||||
* @param objDefMap
|
||||
*/
|
||||
private void handleProcessAttrLeadOrRearProcess(String wsId, List<ModelModel> currentModelNoShape, Map<String, String> idRelationMap, String repositoryModelId, JSONObject elements, ModelModel arisModel,
|
||||
private void handleProcessAttrLeadOrRearProcess(String wsId, Map<String, String> idRelationMap, String repositoryModelId, JSONObject elements, ModelModel arisModel,
|
||||
Map<String, List<ObjOccModel>> modelObjOccMap, Map<String, ObjDefModel> objDefMap) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "PAL流程【" + arisModel.getName() + "】相关前置流程/后置流程进行处理关联", simpleLogFile, fullLogFile);
|
||||
// 如果当前流程下无图形信息 直接返回
|
||||
List<ObjOccModel> objOccModels = modelObjOccMap.get(arisModel.getId());
|
||||
if (objOccModels == null || objOccModels.size() == 0) {
|
||||
currentModelNoShape.add(arisModel);
|
||||
return;
|
||||
}
|
||||
// 获取ARIS图形定义与PAL图形定义关系
|
||||
Map<String, ObjDefMappingModel> objDefMappingMap = ModelMappingAPIManager.getInstance().getObjDefMappingMap();
|
||||
ObjDefMappingModel objDefMappingModel = objDefMappingMap.get("OT_FUNC-ST_PRCS_IF");
|
||||
@ -641,8 +768,6 @@ public class ArisXmlImportRun {
|
||||
PALMethodAttributeModel rearAttrModel = rearProcess.get(0);
|
||||
// 存放待删除图形的KEY
|
||||
List<String> removeKey = new ArrayList<>();
|
||||
// 流程关联属性结果集
|
||||
List<DesignerShapeRelationModel> relationList = new ArrayList<>();
|
||||
for (ObjOccModel objOccModel : objOccModels) {
|
||||
ObjDefModel objDefModel = objDefMap.get(objOccModel.getDefId());// 形状定义
|
||||
// 根据ARIS图形定义信息判断当前模型下的所有形状里是否有系统形状
|
||||
@ -680,6 +805,7 @@ public class ArisXmlImportRun {
|
||||
propertyDao.insert(propertyModel);
|
||||
removeKey.add(key);
|
||||
removeKey.add(shapeId);
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + arisModel.getName() + "】相关前置流程进行处理关联,前置属性内容【" + repositoryModels.get(0).getName() + "】", fullLogFile);
|
||||
break;
|
||||
} else if (tempShapeObj.getJSONObject("to").getString("id").equals(shapeId)) {
|
||||
// rear_process
|
||||
@ -708,6 +834,7 @@ public class ArisXmlImportRun {
|
||||
propertyDao.insert(propertyModel);
|
||||
removeKey.add(key);
|
||||
removeKey.add(shapeId);
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + arisModel.getName() + "】相关后置流程进行处理关联,后置属性内容【" + repositoryModels.get(0).getName() + "】", fullLogFile);
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
@ -717,6 +844,7 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
removeKey.stream().forEach(key -> elements.remove(key));
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + arisModel.getName() + "】相关前置流程/后置流程进行处理关联", simpleLogFile, fullLogFile);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -734,6 +862,7 @@ public class ArisXmlImportRun {
|
||||
private void handleProcessAttrItSystemRelation(String wsId, Map<String, String> idRelationMap, String repositoryModelId, JSONObject elements, ModelModel arisModel,
|
||||
Map<String, List<ObjOccModel>> modelObjOccMap,
|
||||
Map<String, ObjDefModel> objDefMap, Map<String, Set<String>> objDefLinkerMap, Map<String, JSONObject> itShapeMap) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "PAL流程【" + arisModel.getName() + "】相关信息系统与形状进行关联", simpleLogFile, fullLogFile);
|
||||
// 获取ARIS图形定义与PAL图形定义关系
|
||||
Map<String, ObjDefMappingModel> objDefMappingMap = ModelMappingAPIManager.getInstance().getObjDefMappingMap();
|
||||
ObjDefMappingModel objDefMappingModel = objDefMappingMap.get("OT_APPL_SYS_TYPE-ST_APPL_SYS_TYPE");
|
||||
@ -776,17 +905,18 @@ public class ArisXmlImportRun {
|
||||
m.setRelationShapeText(itShapeMap.get(itShapeName).getString("shapeName"));
|
||||
m.setAttrId(Constant.METHOD_INFO_SYSTEM);
|
||||
relationList.add(m);
|
||||
|
||||
} else {
|
||||
// todo warn
|
||||
printMsg("流程【" + arisModel.getName() + "】中的活动节点【" + elements.getJSONObject(shapeId).getString("text") + "】未找到IT系统【" + itShapeName + "】");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "流程【" + arisModel.getName() + "】中的活动节点【" + elements.getJSONObject(shapeId).getString("text") + "】未找到IT系统【" + itShapeName + "】", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 保存关联关系
|
||||
if (relationList.size() > 0) {
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
relationList.stream().forEach(item -> printMsg("流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联当前流程下IT系统【" + item.getRelationShapeText() + "】"));
|
||||
relationList.stream().forEach(item -> LogUtil.appendLog(Constant.LOG_END + "流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联IT系统【" + item.getRelationShapeText() + "】", simpleLogFile, fullLogFile));
|
||||
relationDao.barchInsert(relationList);
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + arisModel.getName() + "】相关信息系统与形状进行关联", simpleLogFile, fullLogFile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -806,6 +936,8 @@ public class ArisXmlImportRun {
|
||||
*/
|
||||
private void handleProcessAttrRoleRelation(String wsId, String repositoryModelId, Map<String, String> arisFunIdRelationPalRoleMap, Map<String, String> palShapeIdRelationArisOccIdMap, JSONObject elements, ModelModel arisModel,
|
||||
Map<String, List<ObjOccModel>> modelObjOccMap, Map<String, ObjDefModel> objDefMap, String roleMdoelId, Map<String, String> palRoleIdRelationNameMap) throws AWSException {
|
||||
|
||||
LogUtil.appendLog(Constant.LOG_START + "PAL流程【" + arisModel.getName() + "】相关角色与形状进行关联,并删除流程图上多余的角色和连线", simpleLogFile, fullLogFile);
|
||||
// 获取ARIS图形定义与PAL图形定义关系
|
||||
Map<String, ObjDefMappingModel> objDefMappingMap = ModelMappingAPIManager.getInstance().getObjDefMappingMap();
|
||||
ObjDefMappingModel objDefMappingModel = objDefMappingMap.get("OT_PERS_TYPE-ST_EMPL_TYPE");
|
||||
@ -857,7 +989,7 @@ public class ArisXmlImportRun {
|
||||
removeKey.add(key);
|
||||
removeKey.add(tempShapeObj.getJSONObject("to").getString("id"));
|
||||
}
|
||||
printMsg("流程" + arisModel.getName() + "删除角色形状" + text + "和其连线");
|
||||
LogUtil.appendLog(Constant.LOG_END + "删除PAL流程【" + arisModel.getName() + "】" + "角色形状【" +text + "】和其连线", fullLogFile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -866,17 +998,19 @@ public class ArisXmlImportRun {
|
||||
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") + ",该角色无连线连接到活动");
|
||||
LogUtil.appendLog(Constant.LOG_END + "删除PAL流程【" + arisModel.getName() + "】" + "角色形状【" + tempShapeObj.getString("text") + "】,该角色无连线连接到活动(角色图中已包含该角色图标)", fullLogFile);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存关联关系
|
||||
if (relationList.size() > 0) {
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
relationList.stream().forEach(item -> printMsg("流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联当前流程下角色【" + item.getRelationShapeText() + "】"));
|
||||
relationList.stream().forEach(item -> LogUtil.appendLog(Constant.LOG_END + "保存PAL流程【" + arisModel.getName() + "】中的活动节点【" + item.getShapeText() + "】关联当前流程下角色【" + item.getRelationShapeText() + "】"));
|
||||
relationDao.barchInsert(relationList);
|
||||
}
|
||||
removeKey.stream().forEach(key -> elements.remove(key));
|
||||
LogUtil.appendLog(Constant.LOG_END + "删除PAL流程【" + arisModel.getName() + "】的相关角色形状和其连线", simpleLogFile, fullLogFile);
|
||||
LogUtil.appendLog(Constant.LOG_END + "PAL流程【" + arisModel.getName() + "】相关角色与形状进行关联,并删除流程图上多余的角色和连线", simpleLogFile, fullLogFile);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -990,7 +1124,6 @@ public class ArisXmlImportRun {
|
||||
* @param coeProcessLevel
|
||||
* @param parentId
|
||||
* @param wsId
|
||||
* @param currentModelNoShape
|
||||
* @param palModel
|
||||
* @param arisModel
|
||||
* @param modelObjOccMap
|
||||
@ -1002,7 +1135,9 @@ public class ArisXmlImportRun {
|
||||
* @param methodAttrsMap
|
||||
* @return
|
||||
*/
|
||||
private String createRoleModelAndElements(PALRepository coeProcessLevel, String parentId, String wsId, List<ModelModel> currentModelNoShape, PALRepositoryModel palModel, ModelModel arisModel, Map<String, List<ObjOccModel>> modelObjOccMap, Map<String, ObjDefModel> objDefMap, Map<String, ObjOccModel> objOccMap, Map<String, List<CxnOccModel>> cxnOccMap, Map<String, Set<String>> objDefLinkerMap, Map<String, String> arisFunIdRelationPalRoleMap, Map<String, Map<String, JSONObject>> methodAttrsMap, Map<String, String> palRoleIdRelationNameMap) {
|
||||
private String createRoleModelAndElements(PALRepository coeProcessLevel, String parentId, String wsId, PALRepositoryModel palModel, ModelModel arisModel, Map<String, List<ObjOccModel>> modelObjOccMap, Map<String, ObjDefModel> objDefMap, Map<String, ObjOccModel> objOccMap, Map<String, List<CxnOccModel>> cxnOccMap, Map<String, Set<String>> objDefLinkerMap, Map<String, String> arisFunIdRelationPalRoleMap, Map<String, Map<String, JSONObject>> methodAttrsMap, Map<String, String> palRoleIdRelationNameMap) {
|
||||
LogUtil.appendLog(Constant.LOG_START + "创建流程模型对应的角色模型", simpleLogFile, fullLogFile);
|
||||
|
||||
// 统计模型内的角色信息,创建角色与形状的关联关系,提前创建活动与角色的id关联关系,建立角色的角色图,角色图中处理岗位为文本属性内容
|
||||
|
||||
// 统计模型内所有的角色形状
|
||||
@ -1016,7 +1151,7 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
if (roleObjOccModels.size() == 0) {
|
||||
printMsg("流程模型" + palModel.getName() + "无任何角色模型,忽略角色与岗位导入");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程【" + arisModel.getName() + "】无任何角色模型,忽略角色与岗位导入", simpleLogFile, fullLogFile, warnLogFile);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1029,7 +1164,7 @@ public class ArisXmlImportRun {
|
||||
List<CxnOccModel> list = cxnOccMap.get(roleOccModel.getId());
|
||||
// list为null,该角色在该模型中没有连接任何的活动,忽略导入该角色
|
||||
if (list == null) {
|
||||
printMsg("流程模型" + palModel.getName() + "检测到角色" + objDefMap.get(roleOccModel.getDefId()).getName() + "尚未连接到任何活动上,忽略该角色");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程【" + arisModel.getName() + "】检测到角色" + objDefMap.get(roleOccModel.getDefId()).getName() + "尚未连接到任何活动上,该角色可能不与任何流程活动相关联", simpleLogFile, fullLogFile, warnLogFile);
|
||||
noneRelationRole.add(objDefMap.get(roleOccModel.getDefId()).getName());
|
||||
continue;
|
||||
}
|
||||
@ -1040,8 +1175,7 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
}
|
||||
if (roleCxnOccModels.size() == 0) {
|
||||
printMsg("流程模型" + palModel.getName() + "无任何角色模型与流程活动进行连接,忽略角色与岗位导入");
|
||||
return null;
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程【" + arisModel.getName() + "】检测到无任何角色模型与流程活动进行连接,该流程与对应的角色图没有关联关系", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
|
||||
// 记录重复的角色,根据名称进行记录
|
||||
@ -1087,11 +1221,11 @@ public class ArisXmlImportRun {
|
||||
ObjDefModel roleObjDefModel = objDefMap.get(roleOccModel.getDefId());
|
||||
String linkedModelIds = roleObjDefModel.getLinkedModelIds();
|
||||
if (UtilString.isEmpty(linkedModelIds)) {// 角色无关联角色图
|
||||
printMsg("流程模型" + palModel.getName() + roleObjDefModel.getName() + "角色无任何关联岗位,忽略该角色岗位");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程【" + arisModel.getName() + "】检测到角色【" + roleObjDefModel.getName() + "】角色无任何关联岗位,忽略该角色的岗位", simpleLogFile, fullLogFile, warnLogFile);
|
||||
} else {// 角色有关联角色图
|
||||
List<ObjOccModel> relationPositonList = modelObjOccMap.get(linkedModelIds);// linkedModelIds按照单个值对待,暂无发现多值
|
||||
if (relationPositonList == null || relationPositonList.size() == 0) {// 角色有关联图但是关联的角色图查询不到
|
||||
printMsg("流程模型" + palModel.getName() + roleObjDefModel.getName() + "角色存在关联LinkedModels.IdRefs:" + linkedModelIds + " 但无法查询对应Model内容");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "Aris流程【" + arisModel.getName() + "】检测到角色【" + roleObjDefModel.getName() + "】角色存在关联的角色图【" + linkedModelIds + "】,但无法查询对应角色图内容,忽略该角色的岗位", simpleLogFile, fullLogFile, warnLogFile);
|
||||
} else {
|
||||
for (ObjOccModel objOccModel: relationPositonList) {
|
||||
ObjDefModel positionDefModel = objDefMap.get(objOccModel.getDefId());
|
||||
@ -1116,7 +1250,7 @@ public class ArisXmlImportRun {
|
||||
id, false, "org.role", "0", 1, null, null, uc.getUID(), uc.getUID(), nowTime, null, null, null, null,
|
||||
null, null, null, null, null, -1);
|
||||
coeProcessLevel.insert(model);
|
||||
printMsg("与流程同名的角色空模型创建完成【文件ID】" + model.getId());
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建与Aris流程同名的角色图【" + arisModel.getName() + "】【" + model.getId() + "】", simpleLogFile, fullLogFile);
|
||||
BaseModel baseModel = CoeDesignerAPIManager.getInstance().getDefinition(model.getId(), 0);
|
||||
if (baseModel == null) {
|
||||
baseModel = CoeDesignerUtil.createModel(model.getId(), 0);
|
||||
@ -1143,11 +1277,13 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
|
||||
JSONArray newShapes = this.getMethodElementsJSONArray(shapes, 6);
|
||||
|
||||
for (int i = 0; i < newShapes.size(); i++) {
|
||||
JSONObject shapeObj = newShapes.getJSONObject(i);
|
||||
elements.put(shapeObj.getString("id"), shapeObj);
|
||||
printMsg("生成角色图 角色【" + shapeObj.getString("text") + "】");
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建角色图【" + arisModel.getName() + "】角色形状图标【" + shapeObj.getString("text") + "】", simpleLogFile);
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "创建角色图【" + arisModel.getName() + "】角色形状图标【" + elements.size() + "】个", simpleLogFile, fullLogFile);
|
||||
|
||||
// 设置角色图形状默认属性配置
|
||||
this.handleShapeDefaultAttr(wsId, palModel, elements, methodAttrsMap);
|
||||
@ -1177,26 +1313,28 @@ public class ArisXmlImportRun {
|
||||
if (attrId.equals(attributesJsonArray.getJSONObject(i).getString("id"))) {
|
||||
flag = true;
|
||||
attributesJsonArray.getJSONObject(i).put("value", postTextVal);
|
||||
printMsg("角色图" + model.getName() + "角色" + shapeText + "岗位属性值为" + postTextVal);
|
||||
LogUtil.appendLog(Constant.LOG_END + "设置角色图【" + arisModel.getName() + "】角色形状图标【" + shapeText + "】的岗位属性值为" + "【" + postTextVal + "】", fullLogFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
printMsg("角色图" + model.getName() + "角色" + shapeText + "没有岗位属性配置" + Constant.METHOD_POST_TEXT);
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "角色图【" + arisModel.getName() + "】角色形状图标【" + shapeText + "】没有岗位属性配置", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printMsg("角色图" + model.getName() + "角色" + shapeText + "无岗位属性内容值");
|
||||
LogUtil.appendLog(Constant.LOG_WARNING + "角色图【" + arisModel.getName() + "】角色形状图标【" + shapeText + "】无岗位属性内容值", simpleLogFile, fullLogFile, warnLogFile);
|
||||
}
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_END + "角色图【" + arisModel.getName() + "】角色形状图标关联岗位内容", simpleLogFile, fullLogFile, warnLogFile);
|
||||
definition.put("elements", elements);
|
||||
// 设置画布大小
|
||||
setDiagramHeightWidth(definition, elements);
|
||||
baseModel.setDefinition(definition.toString());
|
||||
// 保存文件
|
||||
CoeDesignerAPIManager.getInstance().storeDefinition(baseModel);// dao操作
|
||||
LogUtil.appendLog(Constant.LOG_END + "角色图【" + arisModel.getName() + "】新增保存", simpleLogFile, fullLogFile, warnLogFile);
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -1290,41 +1428,20 @@ public class ArisXmlImportRun {
|
||||
}
|
||||
|
||||
/**
|
||||
* Aris模型匹配PAL模型
|
||||
*
|
||||
* @param arisModel
|
||||
* @return
|
||||
* 根据级别排序
|
||||
*/
|
||||
private PALRepositoryModel matchPalModel(ModelModel arisModel, String wsId) {
|
||||
// 查询当前资产库中建模类型是EPC的所有流程文件属性
|
||||
PALRepositoryPropertyDao dao = new PALRepositoryPropertyDao();
|
||||
List<PALRepositoryPropertyModel> propertyModels = dao.queryByWsId(wsId);
|
||||
propertyModels = propertyModels.stream().filter(item -> Constant.METHOD_ARIS_URL.equals(item.getPropertyId())).collect(Collectors.toList());
|
||||
String modelPath = "\\伊利集团业务流程管理平台" + arisModel.getModelPath();
|
||||
boolean flag = false;
|
||||
PALRepositoryModel repositoryModel = null;
|
||||
// printMsg("MODEL PATH "+modelPath);
|
||||
for (PALRepositoryPropertyModel propertyModel : propertyModels) {
|
||||
if (propertyModel.getPropertyValue().equals(modelPath)) {
|
||||
// printMsg("ARIS路径 "+propertyModel.getPropertyValue());
|
||||
repositoryModel = new PALRepository().getInstance(propertyModel.getPlId());
|
||||
if (arisModel.getName().trim().equals(repositoryModel.getName())) {
|
||||
printMsg("匹配到的MODEL PATH " + modelPath + "\\" + arisModel.getName());
|
||||
flag = true;
|
||||
break;
|
||||
} else {
|
||||
repositoryModel = null;
|
||||
}
|
||||
private class Comparator1 implements Comparator<PALRepositoryModel> {
|
||||
@Override
|
||||
public int compare(PALRepositoryModel model1, PALRepositoryModel model2) {
|
||||
Integer level1 = model1.getLevel();
|
||||
Integer level2 = model2.getLevel();
|
||||
int result = level1.compareTo(level2);
|
||||
if (result == 0) {
|
||||
Integer index1 = model1.getOrderIndex();
|
||||
Integer index2 = model2.getOrderIndex();
|
||||
result = index1.compareTo(index2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (!flag) {
|
||||
// 未匹配出结果,记录日志 todo
|
||||
printMsg("未匹配出结果MODEL PATH " + modelPath + "\\" + arisModel.getName());
|
||||
}
|
||||
return repositoryModel;
|
||||
}
|
||||
|
||||
private void printMsg(String msg) {
|
||||
SDK.getLogAPI().consoleInfo(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +1,19 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.aris.web;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.batch.web.create.shape.ImportShapeExcel;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.util.XMLUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.cache.DataMigrationCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.cache.LogRealTimeCountCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogModel;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogRealTimeCountModel;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||
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.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryPropertyDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.CoeDesignerShapeAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.constant.CoeDesignerConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
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.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
@ -38,12 +23,8 @@ import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.bpms.util.UtilDate;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
|
||||
@ -53,7 +34,6 @@ import java.io.IOException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ArisXmlImportWeb extends ActionWeb {
|
||||
|
||||
@ -73,8 +53,9 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
private File warnLogFile;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private long startTime = System.currentTimeMillis();
|
||||
|
||||
Timestamp startDate = new Timestamp(System.currentTimeMillis());
|
||||
// Timestamp startDate = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
|
||||
public void initParams () {
|
||||
@ -128,12 +109,26 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
model.setCreateUserName(_uc.getUserName());
|
||||
model.setCreateDate(createDate);
|
||||
model.setStartDate(createDate);
|
||||
model.setResultType(Constant.LOG_RESULT_TYPE_RUN);
|
||||
model.setResultStatus(Constant.LOG_RESULT_StATUS_RUN);
|
||||
model.setMainInfo("导入进行中");
|
||||
// 存储日志db
|
||||
LogUtil.createLog(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入停止时更新日志db状态
|
||||
* @param logFileMsg
|
||||
* @param logDbMsg
|
||||
*/
|
||||
private void updateErrLog(String logFileMsg, String logDbMsg) {
|
||||
// 记录日志
|
||||
LogUtil.appendLog(logFileMsg, simpleLogFile, fullLogFile, warnLogFile);
|
||||
// 日志表记录导入结果
|
||||
LogUtil.updateLog(logId, new Timestamp(System.currentTimeMillis()), Constant.LOG_RESULT_StATUS_ERROR, logDbMsg);
|
||||
// 清空缓存
|
||||
LogRealTimeCountCache.getCache().remove(logId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 迁移测试
|
||||
*
|
||||
@ -143,6 +138,12 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
public String dataMigrate(String wsId, String groupValue, String fileValue, String fileName) {
|
||||
// 初始化一些参数
|
||||
initParams();
|
||||
// 读取dc
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, "migration");// repositoryName要调整新的路径,配合前端, todo
|
||||
DCContext dc = new DCContext(_uc, dcProfile, Constant.APP_ID, groupValue, fileValue, fileName);
|
||||
this.fileName = fileName;
|
||||
this.filePath = dc.getFilePath();
|
||||
Timestamp startDate = new Timestamp(startTime);
|
||||
// 创建日志信息db
|
||||
createLogModel(logId, wsId, fileName, filePath, startDate);
|
||||
LogUtil.appendLog("注:该日志文件存储简要日志信息", simpleLogFile);
|
||||
@ -151,10 +152,14 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
|
||||
LogUtil.appendLog("Aris XML流程导入 Begin " + UtilDate.datetimeFormat(startDate), simpleLogFile, fullLogFile, warnLogFile);
|
||||
|
||||
String msg;
|
||||
|
||||
// 校验资产库是否存在可用
|
||||
boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(wsId);
|
||||
if (!isActive) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "资产库不存在或已停用," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "资产库不存在或已停用," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("资产库不存在或已停用").toString();
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验资产库存在并可用", simpleLogFile, fullLogFile);
|
||||
|
||||
@ -164,17 +169,17 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
return checkRo.toString();
|
||||
}
|
||||
// 校验文件是否存在
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, "migration");// repositoryName要调整新的路径,配合前端, todo
|
||||
DCContext dc = new DCContext(_uc, dcProfile, Constant.APP_ID, groupValue, fileValue, fileName);
|
||||
File file = new File(dc.getFilePath());
|
||||
if (!file.exists()) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "上传文件不存在," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "上传文件不存在," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("上传文件不存在").toString();
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验上传文件是否存在", simpleLogFile, fullLogFile);
|
||||
|
||||
if (!".xml".equals(fileName.substring(fileName.lastIndexOf(".")))) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "上传文件名称格式不正确," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "上传文件名称格式不正确," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("上传文件名称格式不正确,请上传XML文件").toString();
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验上传文件是否为XML格式", simpleLogFile, fullLogFile);
|
||||
@ -185,7 +190,8 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
// XMLUtil.writeXml(d, toFilePath + fileName);
|
||||
// 解析xml文件
|
||||
if (doc == null) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "解析XML文件结构," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "解析XML文件结构," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("解析XML文件错误,详情见日志").toString();
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "解析XML文件结构", simpleLogFile, fullLogFile);
|
||||
@ -195,26 +201,36 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
handleWeb.handleXmlDoc(doc);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "解析XML文件内容异常,异常信息:" + e.getMessage() + "," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "解析XML文件内容异常,异常信息:" + e.getMessage() + "," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "解析XML文件内容", simpleLogFile, fullLogFile);
|
||||
|
||||
// 统计epc流程图的个数,用以进度展示
|
||||
int totalEpcCount = countProcessMainInfo(handleWeb.modelMap);
|
||||
if (totalEpcCount == 0) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "上传文件不包含任何" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC) + "," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
msg = Constant.LOG_ERROR + "上传文件不包含任何" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC) + "," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("上传文件不包含任何" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC)).toString();
|
||||
}
|
||||
// 存储缓存,导入计数
|
||||
DataMigrationCache.getCache().put(logId, 0, true);
|
||||
// 开始执行导入
|
||||
new Thread(()->{new ArisXmlImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, filePath, fileName).execute(handleWeb);}) .start();
|
||||
LogRealTimeCountModel countModel = new LogRealTimeCountModel();
|
||||
countModel.setTotalCount(totalEpcCount);
|
||||
countModel.setSuccessCount(0);
|
||||
countModel.setArisBlankCount(0);
|
||||
countModel.setPalExistsCount(0);
|
||||
countModel.setImportingCount(0);
|
||||
countModel.setMatchFieldCount(0);
|
||||
LogRealTimeCountCache.getCache().put(logId, countModel, true);
|
||||
|
||||
ResponseObject ro = ResponseObject.newOkResponse("处理完毕");
|
||||
// ro.put("matchModels", matchModels);
|
||||
// ro.put("unMatchModels", unMatchModels);
|
||||
// ro.put("repeatModels", repeatModels);
|
||||
// ro.put("currentModelNoShape", currentModelNoShape);
|
||||
LogUtil.appendLog(Constant.LOG_START + "导入" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC + ",共【" + totalEpcCount + "】条流程"));
|
||||
// 开始执行导入
|
||||
new Thread(()->{new ArisXmlImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(handleWeb);}) .start();
|
||||
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
ro.put("logId", logId);
|
||||
ro.put("path", logPath);
|
||||
ro.put("endLog", Constant.END_LOG);
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
@ -245,10 +261,12 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
d = XMLUtil.readXML(path, true);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
String msg = Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
String msg = Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
@ -261,7 +279,7 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
private ResponseObject checkMethodConfig(String wsId) {
|
||||
// 校验EPC图的文件属性
|
||||
// 校验前置流程、后置流程
|
||||
ResponseObject checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, null, Constant.METHOD_PRE_PROCESS, Constant.METHOD_NEXT_PROCESS);
|
||||
ResponseObject checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, null, Constant.METHOD_PRE_PROCESS, Constant.METHOD_NEXT_PROCESS, Constant.METHOD_ARIS_URL);
|
||||
if (checkRo.isErr()) {
|
||||
return checkRo;
|
||||
}
|
||||
@ -276,19 +294,16 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
if (checkRo.isErr()) {
|
||||
return checkRo;
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "【EPC流程图】形状【线下审批】的属性【编号】【输入】【输出】【描述】【角色】【信息系统】", simpleLogFile, fullLogFile);
|
||||
// 校验系统任务的编号、输入、输出、描述、角色、信息系统
|
||||
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_APPROVAL_NODE3, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||
if (checkRo.isErr()) {
|
||||
return checkRo;
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "【EPC流程图】形状【系统任务】的属性【编号】【输入】【输出】【描述】【角色】【信息系统】", simpleLogFile, fullLogFile);
|
||||
// 校验人工任务的编号、输入、输出、描述、角色、信息系统
|
||||
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_SERVICE_NODE4, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||
if (checkRo.isErr()) {
|
||||
return checkRo;
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "【EPC流程图】形状【人工任务】的属性【编号】【输入】【输出】【描述】【角色】【信息系统】", simpleLogFile, fullLogFile);
|
||||
// 校验角色图的岗位属性
|
||||
// 校验角色的岗位文本
|
||||
checkRo = checkMethodAttrExist(wsId, Constant.ORG_ROLE, Constant.METHOD_ROLE, Constant.METHOD_POST_TEXT);
|
||||
@ -311,7 +326,8 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
if (UtilString.isNotEmpty(shapeName)) {
|
||||
JSONObject shape = ShapeUtil.getProcessShapeDefinitionByName(methodId, shapeName);
|
||||
if (isEmptyJsonOject(shape)) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeName + "】不存在," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeName + "】不存在," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("模型【" + methodName + "】中的形状【" + shapeName + "】不存在");
|
||||
}
|
||||
String shapeText = shape.getString("text");
|
||||
@ -322,8 +338,9 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
}
|
||||
for (String attrId : attrs) {
|
||||
if (!attrMap.containsKey(attrId)) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
return ResponseObject.newErrResponse("模型【" + methodName + "】中的形状【" + shapeName + "】属性【" + attrId + "】不存在");
|
||||
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】不存在");
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】", simpleLogFile, fullLogFile);
|
||||
}
|
||||
@ -336,7 +353,8 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
}
|
||||
for (String attrId : attrs) {
|
||||
if (!attrMap.containsKey(attrId)) {
|
||||
LogUtil.appendLog(Constant.LOG_ERROR + "模型【" + methodName + "】的文件属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG, simpleLogFile, fullLogFile, warnLogFile);
|
||||
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】的文件属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG;
|
||||
updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("模型【" + methodName + "】的文件属性【" + attrId + "】不存在");
|
||||
}
|
||||
LogUtil.appendLog(Constant.LOG_SUCCESS + "模型【" + methodName + "】的文件属性【" + attrId + "】", simpleLogFile, fullLogFile);
|
||||
@ -345,37 +363,6 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
return ResponseObject.newOkResponse();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验一些必备的建模属性
|
||||
* @param wsId
|
||||
* @param shapeMethodId
|
||||
* @param shapeMethodName
|
||||
* @param methodId
|
||||
* @param categoryName
|
||||
* @param methodName
|
||||
* @param methodCode
|
||||
* @return
|
||||
*/
|
||||
private String checkMethodInfo(String wsId, String shapeMethodId, String shapeMethodName, String methodId, String categoryName, String methodName, String methodCode) {
|
||||
// 一些环境提前校验 比如必备的建模属性
|
||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAttributeModels(wsId, shapeMethodId, shapeMethodName, methodId);
|
||||
attributeModels = attributeModels.stream().filter(item -> methodCode.equals(item.getKey())).collect(Collectors.toList());
|
||||
if (attributeModels.size() == 0) {
|
||||
return ResponseObject.newErrResponse("请打开建模管理应用,查看当前建模分类【" + categoryName + "】下是否存在【" + methodName + "/" + methodCode + "】建模属性").toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验是否为空的对象
|
||||
* @param o
|
||||
@ -385,9 +372,4 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
return o == null || o.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.cache;
|
||||
|
||||
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||
|
||||
/**
|
||||
* 存储导入数据
|
||||
* @author sunlh
|
||||
*
|
||||
*/
|
||||
public class DataMigrationCache extends Cache<String, Integer>{
|
||||
|
||||
public DataMigrationCache(CachePluginProfile configuration) {
|
||||
super(configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void load() {
|
||||
}
|
||||
|
||||
public static DataMigrationCache getCache() {
|
||||
return CacheManager.getCache(DataMigrationCache.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -64,14 +64,24 @@ public class Constant {
|
||||
public static final String LOG_SUCCESS = "【成功】";
|
||||
public static final String LOG_WARNING = "【警告】";
|
||||
public static final String LOG_ERROR = "【错误】";
|
||||
// 日志导入开始节点
|
||||
public static final String LOG_START = "【开始】";
|
||||
// 日志导入完成节点
|
||||
public static final String LOG_END = "【完成】";
|
||||
public static final String LOG_DESC = "【说明】";
|
||||
|
||||
// 日志表resultType字段常量codeß
|
||||
public static final int LOG_RESULT_TYPE_RUN = 0;// 进行中
|
||||
public static final int LOG_RESULT_TYPE_SUCCESS = 1;// 完成
|
||||
public static final int LOG_RESULT_TYPE_ERROR = 2;// 失败
|
||||
|
||||
// 日志表resultType字段常量code
|
||||
public static final int LOG_RESULT_StATUS_RUN = 0;// 进行中
|
||||
public static final int LOG_RESULT_StATUS_SUCCESS = 1;// 完成
|
||||
public static final int LOG_RESULT_StATUS_ERROR = 2;// 失败
|
||||
|
||||
public static final String IMPORT_STOP_MSG = "导入停止";
|
||||
|
||||
// 日志结束语
|
||||
public static final String END_LOG = "**建议下载本次输出日志做备忘";
|
||||
|
||||
|
||||
public static final String PROCESS_EPC = "process.epc";
|
||||
|
||||
public static final String ORG_ROLE = "org.role";
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.log.cache;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogRealTimeCountModel;
|
||||
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||
|
||||
/**
|
||||
* 存储导入数据
|
||||
* @author sunlh
|
||||
*
|
||||
*/
|
||||
public class LogRealTimeCountCache extends Cache<String, LogRealTimeCountModel>{
|
||||
|
||||
public LogRealTimeCountCache(CachePluginProfile configuration) {
|
||||
super(configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void load() {
|
||||
}
|
||||
|
||||
public static LogRealTimeCountCache getCache() {
|
||||
return CacheManager.getCache(LogRealTimeCountCache.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -38,7 +38,7 @@ public class LogDao extends DaoObject<LogModel> {
|
||||
paraMap.put(LogModel.CREATEDATE, model.getCreateDate());
|
||||
paraMap.put(LogModel.STARTDATE, model.getStartDate());
|
||||
paraMap.put(LogModel.ENDDATE, model.getEndDate());
|
||||
paraMap.put(LogModel.RESULTTYPE, model.getResultType());
|
||||
paraMap.put(LogModel.RESULTSTATUS, model.getResultStatus());
|
||||
paraMap.put(LogModel.MAININFO, model.getMainInfo());
|
||||
paraMap.put(LogModel.EXT1, model.getExt1());
|
||||
paraMap.put(LogModel.EXT2, model.getExt2());
|
||||
@ -62,7 +62,7 @@ public class LogDao extends DaoObject<LogModel> {
|
||||
+ LogModel.CREATEDATE +"=?, "
|
||||
+ LogModel.STARTDATE +"=?, "
|
||||
+ LogModel.ENDDATE +"=?, "
|
||||
+ LogModel.RESULTTYPE +"=?, "
|
||||
+ LogModel.RESULTSTATUS +"=?, "
|
||||
+ LogModel.MAININFO +"=?, "
|
||||
+ LogModel.EXT1 +"=?, "
|
||||
+ LogModel.EXT2 +"=?, "
|
||||
@ -70,7 +70,7 @@ public class LogDao extends DaoObject<LogModel> {
|
||||
+ LogModel.EXT4 +"=? "
|
||||
+ "WHERE "+ LogModel.ID +"=? ";
|
||||
return DBSql.update(updateSql, new Object[] {model.getWsId(), model.getFileName(), model.getFilePath(), model.getLogPath(), model.getCreateUser(), model.getCreateUserName(),
|
||||
model.getCreateDate(), model.getStartDate(), model.getEndDate(), model.getResultType(), model.getMainInfo(), model.getExt1(), model.getExt2(), model.getExt3(), model.getExt4(), model.getId()});
|
||||
model.getCreateDate(), model.getStartDate(), model.getEndDate(), model.getResultStatus(), model.getMainInfo(), model.getExt1(), model.getExt2(), model.getExt3(), model.getExt4(), model.getId()});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,7 +84,7 @@ public class LogDao extends DaoObject<LogModel> {
|
||||
public int update(String id, Timestamp endDate, int resultType, String mainInfo) {
|
||||
String updateSql = "UPDATE "+ entityName()
|
||||
+ " SET "+ LogModel.ENDDATE +"=?, "
|
||||
+ LogModel.RESULTTYPE +"=?, "
|
||||
+ LogModel.RESULTSTATUS +"=?, "
|
||||
+ LogModel.MAININFO +"=? "
|
||||
+ "WHERE "+ LogModel.ID +"=? ";
|
||||
return DBSql.update(updateSql, new Object[] {endDate, resultType, mainInfo, id});
|
||||
@ -152,7 +152,7 @@ public class LogDao extends DaoObject<LogModel> {
|
||||
model.setCreateDate(rset.getTimestamp(LogModel.CREATEDATE));
|
||||
model.setStartDate(rset.getTimestamp(LogModel.STARTDATE));
|
||||
model.setEndDate(rset.getTimestamp(LogModel.ENDDATE));
|
||||
model.setResultType(rset.getInt(LogModel.RESULTTYPE));
|
||||
model.setResultStatus(rset.getInt(LogModel.RESULTSTATUS));
|
||||
model.setMainInfo(rset.getString(LogModel.MAININFO));
|
||||
model.setExt1(rset.getString(LogModel.EXT1));
|
||||
model.setExt2(rset.getString(LogModel.EXT2));
|
||||
|
||||
@ -18,7 +18,7 @@ public class LogModel {
|
||||
public static final String CREATEDATE = "CREATEDATE";
|
||||
public static final String STARTDATE = "STARTDATE";
|
||||
public static final String ENDDATE = "ENDDATE";
|
||||
public static final String RESULTTYPE = "RESULTTYPE";
|
||||
public static final String RESULTSTATUS = "RESULTSTATUS";
|
||||
public static final String MAININFO = "MAININFO";
|
||||
public static final String EXT1 = "EXT1";
|
||||
public static final String EXT2 = "EXT2";
|
||||
@ -37,7 +37,7 @@ public class LogModel {
|
||||
private Timestamp createDate;// 上传时间,程序开始导入时间
|
||||
private Timestamp startDate;// 上传时间,程序开始导入时间
|
||||
private Timestamp endDate;// 最终结束时间,成功/失败都需要记录
|
||||
private int resultType;// 结果,0进行中,1成功,2失败
|
||||
private int resultStatus;// 结果状态,0进行中,1成功,2失败
|
||||
private String mainInfo;// 一句话简介整个上传结果,内容无限制,示例:若是进行中可描述为:正在上传;若是失败可描述为具体的异常信息;若是成功可描述为:上传多少条,成功多少条信息
|
||||
private String ext1;// 扩展字段
|
||||
private String ext2;// 扩展字段
|
||||
@ -127,12 +127,12 @@ public class LogModel {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public int getResultType() {
|
||||
return resultType;
|
||||
public int getResultStatus() {
|
||||
return resultStatus;
|
||||
}
|
||||
|
||||
public void setResultType(int resultType) {
|
||||
this.resultType = resultType;
|
||||
public void setResultStatus(int resultStatus) {
|
||||
this.resultStatus = resultStatus;
|
||||
}
|
||||
|
||||
public String getMainInfo() {
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.log.model;
|
||||
|
||||
import com.actionsoft.bpms.commons.mvc.model.ModelBean;
|
||||
|
||||
|
||||
public class LogRealTimeCountModel extends ModelBean {
|
||||
|
||||
private int totalCount;// 总共条数
|
||||
private int successCount;// 成功条数
|
||||
private int importingCount;// 当前正在导入的第几条数据
|
||||
private int palExistsCount;// pal已存在条数,针对Aris xml流程导入
|
||||
private int arisBlankCount;// aris没有模型的条数,针对Aris xml流程导入
|
||||
private int matchFieldCount;// aris与PAL匹配失败的数据条数,针对Aris xml流程导入
|
||||
// 可自定义其他类型数据导入/迁移计数对象
|
||||
|
||||
|
||||
public LogRealTimeCountModel() {
|
||||
}
|
||||
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public int getSuccessCount() {
|
||||
return successCount;
|
||||
}
|
||||
|
||||
public void setSuccessCount(int successCount) {
|
||||
this.successCount = successCount;
|
||||
}
|
||||
|
||||
public int getPalExistsCount() {
|
||||
return palExistsCount;
|
||||
}
|
||||
|
||||
public void setPalExistsCount(int palExistsCount) {
|
||||
this.palExistsCount = palExistsCount;
|
||||
}
|
||||
|
||||
public int getArisBlankCount() {
|
||||
return arisBlankCount;
|
||||
}
|
||||
|
||||
public void setArisBlankCount(int arisBlankCount) {
|
||||
this.arisBlankCount = arisBlankCount;
|
||||
}
|
||||
|
||||
public int getImportingCount() {
|
||||
return importingCount;
|
||||
}
|
||||
|
||||
public void setImportingCount(int importingCount) {
|
||||
this.importingCount = importingCount;
|
||||
}
|
||||
|
||||
public int getMatchFieldCount() {
|
||||
return matchFieldCount;
|
||||
}
|
||||
|
||||
public void setMatchFieldCount(int matchFieldCount) {
|
||||
this.matchFieldCount = matchFieldCount;
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.plugin;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.cache.DataMigrationCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.cache.LogRealTimeCountCache;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
|
||||
import com.actionsoft.apps.listener.PluginListener;
|
||||
@ -24,7 +24,7 @@ public class Plugins implements PluginListener {
|
||||
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
||||
|
||||
// 注册缓存
|
||||
list.add(new CachePluginProfile(DataMigrationCache.class));
|
||||
list.add(new CachePluginProfile(LogRealTimeCountCache.class));
|
||||
|
||||
list.add(new DCPluginProfile("migration", CoeFileProcessor.class.getName(), "存放数据迁移文件", false, false));
|
||||
list.add(new DCPluginProfile(ArisConstant.REPOSITORY_NAME, CoeFileProcessor.class.getName(), "存在arisXML数据迁移日志", false, false));
|
||||
|
||||
@ -9,11 +9,14 @@ 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.PALRepositoryQueryAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
|
||||
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
||||
import com.actionsoft.apps.resource.AppContext;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -183,11 +186,8 @@ public class ProcessUtil {
|
||||
* @return
|
||||
*/
|
||||
public static boolean isView(PALRepositoryModel model) {
|
||||
if (model.isPublish() || model.isApproval() || model.isStop()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return model.isPublish() || model.isApproval() || model.isStop();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -197,10 +197,21 @@ public class ProcessUtil {
|
||||
public static boolean isBlank(UserContext uc, PALRepositoryModel model) {
|
||||
String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(uc, model.getId());
|
||||
JSONObject array = JSONObject.parseObject(define);
|
||||
if (array.containsKey("elements") && array.getJSONObject("elements").size() == 0) {
|
||||
return true;
|
||||
return array.containsKey("elements") && array.getJSONObject("elements").size() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型文本路径
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static String getRepositoryPath(String id) {
|
||||
JSONArray pathArr = CoeProcessLevelUtil.getRepositoryPath(id);
|
||||
List<String> list = new ArrayList<>();
|
||||
for (int i = 0; i < pathArr.size(); i++) {
|
||||
list.add(pathArr.getJSONObject(i).getString("name"));
|
||||
}
|
||||
return false;
|
||||
return StringUtils.join(list, "\\");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user