fix(系统设置): 修复导入用户工作空间名称为空导致导入失败问题

--bug=1033309 --user=王旭 【系统设置】github#27781 导入用户工作空间名称是空时导入报错提示优化 https://www.tapd.cn/55049933/s/1446090
This commit is contained in:
WangXu10 2023-12-20 14:54:01 +08:00 committed by 刘瑞斌
parent dc91c99ef0
commit dbabc78143
1 changed files with 9 additions and 0 deletions

View File

@ -150,6 +150,9 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
private String checkWorkSpace(String userRoleInExcel, String workspaceInfoInExcel) { private String checkWorkSpace(String userRoleInExcel, String workspaceInfoInExcel) {
String result = null; String result = null;
if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) { if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) {
if(StringUtils.isBlank(workspaceInfoInExcel)){
return result;
}
String[] workspaceArr = workspaceInfoInExcel.split(StringUtils.LF); String[] workspaceArr = workspaceInfoInExcel.split(StringUtils.LF);
for (String workspace : for (String workspace :
workspaceArr) { workspaceArr) {
@ -175,6 +178,9 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
private String checkProject(String userGroupInExcel, String projectInfoInExcel) { private String checkProject(String userGroupInExcel, String projectInfoInExcel) {
String result = null; String result = null;
if (StringUtils.equalsAnyIgnoreCase(Translator.get("options_yes"), userGroupInExcel)) { if (StringUtils.equalsAnyIgnoreCase(Translator.get("options_yes"), userGroupInExcel)) {
if(StringUtils.isBlank(projectInfoInExcel)){
return result;
}
String[] projectNameArr = projectInfoInExcel.split(StringUtils.LF); String[] projectNameArr = projectInfoInExcel.split(StringUtils.LF);
for (String projectName : projectNameArr) { for (String projectName : projectNameArr) {
if (!projectNameMap.containsKey(projectName)) { if (!projectNameMap.containsKey(projectName)) {
@ -200,6 +206,9 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
private List<String> getIdByExcelInfoAndIdDic(String userRoleInExcel, String nameStringInExce, Map<String, String> idDic) { private List<String> getIdByExcelInfoAndIdDic(String userRoleInExcel, String nameStringInExce, Map<String, String> idDic) {
List<String> resultList = new ArrayList<>(); List<String> resultList = new ArrayList<>();
if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) { if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) {
if(StringUtils.isBlank(nameStringInExce)){
return resultList;
}
String[] nameArr = nameStringInExce.split(StringUtils.LF); String[] nameArr = nameStringInExce.split(StringUtils.LF);
for (String name : nameArr) { for (String name : nameArr) {
if (idDic.containsKey(name)) { if (idDic.containsKey(name)) {