Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug-8645][Api] Resource Re Upload, name duplicate #8811

Merged
merged 8 commits into from
Mar 10, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -1108,16 +1108,20 @@ private boolean checkAndImport(User loginUser, long projectCode, Map<String, Obj
return false;
}
ProcessDefinition processDefinition = dagDataSchedule.getProcessDefinition();

// generate import processDefinitionName
String processDefinitionName = recursionProcessDefinitionName(projectCode, processDefinition.getName(), 1);
String importProcessDefinitionName = processDefinitionName + "_import_" + DateUtils.getCurrentTimeStamp();

//unique check
Map<String, Object> checkResult = verifyProcessDefinitionName(loginUser, projectCode, processDefinition.getName());
Map<String, Object> checkResult = verifyProcessDefinitionName(loginUser, projectCode, importProcessDefinitionName);
if (Status.SUCCESS.equals(checkResult.get(Constants.STATUS))) {
putMsg(result, Status.SUCCESS);
} else {
result.putAll(checkResult);
return false;
}
String processDefinitionName = recursionProcessDefinitionName(projectCode, processDefinition.getName(), 1);
processDefinition.setName(processDefinitionName + "_import_" + DateUtils.getCurrentTimeStamp());
processDefinition.setName(importProcessDefinitionName);
processDefinition.setId(0);
processDefinition.setProjectCode(projectCode);
processDefinition.setUserId(loginUser.getId());
Expand Down