岗位导入流程名称由aris流程名称改为pal流程名称

This commit is contained in:
446052889@qq.com 2022-08-29 10:28:06 +08:00
parent 5090aac0d1
commit 3b68106b0a
3 changed files with 23 additions and 23 deletions

View File

@ -98,10 +98,10 @@ public class PositionExcelImportRun {
/**
* 执行导入
* @param processMap Excel流程mapkey流程名称valueExcel中该流程的活动+角色与岗位信息
* @param arisNameMap pal的流程与aris流程名称的关系mapkeyaris流程名称valuekey对应的pal流程id
* @param palNameMap pal的流程与流程名称的关系mapkeypal流程名称valuekey对应的pal流程id
* @param posMap pal的组织图的岗位关系mapkeypal的组织的岗位名称value该岗位对应的组织
*/
public void execute(Map<String, List<PositionValidDataModel>> processMap, Map<String, String> arisNameMap, Map<String, PalOrgPositionModel> posMap) {
public void execute(Map<String, List<PositionValidDataModel>> processMap, Map<String, String> palNameMap, Map<String, PalOrgPositionModel> posMap) {
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
try {
int totalCount = LogRealTimeCountCache.getCache().get(logId).getTotalCount();
@ -117,14 +117,14 @@ public class PositionExcelImportRun {
LogUtil.appendLog("\n" + Constant.LOG_START + "************[执行阶段][流程匹配阶段]PAL过程链图与Excel中流程进行匹配************", simpleLogFile, fullLogFile);
// 校验pal是否存在该流程
if (!arisNameMap.containsKey(processName)) {
if (!palNameMap.containsKey(processName)) {
// Excel中的流程在PAL中不存在当作警告处理全部记录
LogUtil.appendLog(Constant.LOG_WARNING + "Excel流程" + "[" + processName + "]未在PAL中找到忽略导入", simpleLogFile, fullLogFile, warnLogFile);
LogUtil.appendLog("[流程未找到]Excel流程" + "[" + processName + "]未在PAL中找到忽略导入", matchErrImportFile);
LogRealTimeCountCache.getCache().get(logId).setArisBlankCount(LogRealTimeCountCache.getCache().get(logId).getArisBlankCount() + 1);// 借用ArisBlankCount
continue;
}
String palId = arisNameMap.get(processName);
String palId = palNameMap.get(processName);
List<DesignerShapeRelationModel> insertModels = new ArrayList<>();// 匹配上待保存的数据
List<DesignerShapeRelationModel> delModels = new ArrayList<>();// 待删除的数据Excel中存在代表要更新/删除

View File

@ -285,12 +285,12 @@ public class PositionExcelImportWeb extends ActionWeb {
}
excelModelList = excelModelList2;
// 校验aris流程名称是否重复
Map<String, String> arisNameMap = ProcessUtil.getPalRepositoryArisNameMap(wsId);// 获取流程以及流程的aris名称
ResponseObject checkRepeatArisNameRo = checkRepositoryPropArisName(arisNameMap);
if (!checkRepeatArisNameRo.isOk()) {
msg = Constant.LOG_ERROR + checkRepeatArisNameRo.getMsg() + "" + Constant.IMPORT_STOP_MSG;
Map<String, String> palNameMap = ProcessUtil.getPalRepositoryNameMap(wsId, Constant.PROCESS_EPC);// 获取流程以及流程的aris名称
ResponseObject checkRepeatPalNameRo = checkRepositoryName(palNameMap);
if (!checkRepeatPalNameRo.isOk()) {
msg = Constant.LOG_ERROR + checkRepeatPalNameRo.getMsg() + "" + Constant.IMPORT_STOP_MSG;
updateErrLog(msg, msg);
ro.err(checkRepeatArisNameRo.getMsg());
ro.err(checkRepeatPalNameRo.getMsg());
return ro.toString();
}
// 岗位重复校验 todo
@ -382,9 +382,9 @@ public class PositionExcelImportWeb extends ActionWeb {
processMap.get(model.getProcessName()).add(model);
}
// Aris流程名称与PALID反转
Map<String, String> arisNameMap2 = new HashMap<>();
for (Map.Entry<String, String> entry : arisNameMap.entrySet()) {
arisNameMap2.put(entry.getValue(), entry.getKey());
Map<String, String> palNameMap2 = new HashMap<>();
for (Map.Entry<String, String> entry : palNameMap.entrySet()) {
palNameMap2.put(entry.getValue(), entry.getKey());
}
int totalCount = processMap.size();
@ -402,7 +402,7 @@ public class PositionExcelImportWeb extends ActionWeb {
LogUtil.appendLog("\n" + Constant.LOG_START + "预计导入[" + fileName + "]" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC + ",共[" + totalCount + "]条流程"));
// 开始执行导入
new Thread(()->{new PositionExcelImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(processMap, arisNameMap2, posMap);}) .start();
new Thread(()->{new PositionExcelImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(processMap, palNameMap2, posMap);}) .start();
ro.put("totalCount", totalCount);
ro.put("importingCount", LogRealTimeCountCache.getCache().get(logId).getImportingCount());
@ -411,23 +411,23 @@ public class PositionExcelImportWeb extends ActionWeb {
/**
* 校验流程Aris名称
* @param arisNameMap
* @param palNameMap
* @return
*/
private ResponseObject checkRepositoryPropArisName(Map<String, String> arisNameMap) {
private ResponseObject checkRepositoryName(Map<String, String> palNameMap) {
boolean isOk = true;
Map<String, List<String>> map = new HashMap<>();
for (Map.Entry<String, String> entry : arisNameMap.entrySet()) {
for (Map.Entry<String, String> entry : palNameMap.entrySet()) {
String palId = entry.getKey();
String arisName = entry.getValue();
if (!map.containsKey(arisName)) {
map.put(arisName, new ArrayList<>());
String palName = entry.getValue();
if (!map.containsKey(palName)) {
map.put(palName, new ArrayList<>());
}
map.get(arisName).add(palId);
map.get(palName).add(palId);
}
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
List<String> idList = entry.getValue();
String arisName = entry.getKey();
String palName = entry.getKey();
if (idList.size() > 1) {
isOk = false;
List<String> nameList = new ArrayList<>();
@ -435,11 +435,11 @@ public class PositionExcelImportWeb extends ActionWeb {
PALRepositoryModel model = PALRepositoryCache.getCache().get(palId);
nameList.add(model.getName());
}
LogUtil.appendLog(Constant.LOG_ERROR + "同一Aris流程名称[" + arisName + "]对应多个PAL流程[" + StringUtils.join(nameList, "") + "]", simpleLogFile, fullLogFile, simpleLogFile, fullLogFile);
LogUtil.appendLog(Constant.LOG_ERROR + "同一PAL流程名称[" + palName + "]存在多个", simpleLogFile, fullLogFile, simpleLogFile, fullLogFile);
}
}
if (!isOk) {
return ResponseObject.newErrResponse("存在同一Aris流程名称对应多个PAL流程,详情见日志");
return ResponseObject.newErrResponse("存在同一PAL流程名称对应多个流程,详情见日志");
}
return ResponseObject.newOkResponse();
}