|
|
@ -179,7 +179,7 @@ public class ExcelService implements IExcelService { |
|
|
|
private void readProject(XSSFSheet wbsSheet, int projectInfoStart, int projectInfoEnd, Long currentUserId, SysProject sysProject) throws Exception { |
|
|
|
XSSFRow row = wbsSheet.getRow(projectInfoStart + 1); |
|
|
|
if(ObjectUtil.isNull(row)){ |
|
|
|
throw new BaseException(CodeEnum.notProject(wbsSheet.getSheetName() + (projectInfoStart + 1))); |
|
|
|
// throw new BaseException(CodeEnum.notProject(wbsSheet.getSheetName() + (projectInfoStart + 1)));
|
|
|
|
} |
|
|
|
String projectName = ExcelUtil.getCellValue(row.getCell(0)); |
|
|
|
if (StrUtil.isNotEmpty(projectName)) { |
|
|
@ -292,6 +292,8 @@ public class ExcelService implements IExcelService { |
|
|
|
|
|
|
|
Long firstRoleId = null; |
|
|
|
Long secondRoleId = null; |
|
|
|
//循环结束判断字符串allOneRole是否包含PM和Member
|
|
|
|
String allOneRole = ""; |
|
|
|
for (int i = memberStart + 1; i <= memberEnd; i++) { |
|
|
|
XSSFRow row = wbsSheet.getRow(i); |
|
|
|
if(ObjectUtil.isNull(row)){ |
|
|
@ -314,24 +316,31 @@ public class ExcelService implements IExcelService { |
|
|
|
if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.God.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.God.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.God.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.God.value; |
|
|
|
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ManageRepresent.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.ManageRepresent.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.ManageRepresent.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.ManageRepresent.value; |
|
|
|
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Stakeholder.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.Stakeholder.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.Stakeholder.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.Stakeholder.value; |
|
|
|
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.PM.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.PM.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.PM.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.PM.value; |
|
|
|
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Member.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.Member.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.Member.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.Member.value; |
|
|
|
} else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.Attention.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.Attention.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.Attention.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.Attention.value; |
|
|
|
}else if (proRoleCell.equalsIgnoreCase(WebConstant.ROLE_NAME.ProjectVirtualRole.phase)) { |
|
|
|
role.setName(WebConstant.ROLE_NAME.ProjectVirtualRole.value); |
|
|
|
role.setDescription(WebConstant.ROLE_NAME.ProjectVirtualRole.phase); |
|
|
|
allOneRole += WebConstant.ROLE_NAME.ProjectVirtualRole.value; |
|
|
|
} else { |
|
|
|
throw new BaseException(CodeEnum.WBS_NOT_FIRST_ROLE.addMsg(wbsSheet.getSheetName() + (i+1))); |
|
|
|
|
|
|
@ -351,7 +360,8 @@ public class ExcelService implements IExcelService { |
|
|
|
// }
|
|
|
|
} |
|
|
|
if (ObjectUtil.isNull(firstRoleId)) { |
|
|
|
throw new BaseException("找不到系统角色[" + (i + 1) + "]"); |
|
|
|
continue; |
|
|
|
// throw new BaseException("找不到系统角色[" + (i + 1) + "]");
|
|
|
|
} |
|
|
|
//二级角色
|
|
|
|
if (StrUtil.isNotEmpty(secondRoleCell)) { |
|
|
@ -383,7 +393,8 @@ public class ExcelService implements IExcelService { |
|
|
|
} |
|
|
|
} |
|
|
|
if (ObjectUtil.isNull(secondRoleId)) { |
|
|
|
throw new BaseException("找不到二级角色[" + (i+1) + "]"); |
|
|
|
continue; |
|
|
|
// throw new BaseException("找不到二级角色[" + (i+1) + "]");
|
|
|
|
} |
|
|
|
//添加角色成员关联信息
|
|
|
|
if (StrUtil.isNotEmpty(memberCell)) { |
|
|
@ -425,6 +436,12 @@ public class ExcelService implements IExcelService { |
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
if (!allOneRole.contains(WebConstant.ROLE_NAME.PM.value)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_FOUND_PM); |
|
|
|
} |
|
|
|
if (!allOneRole.contains(WebConstant.ROLE_NAME.Member.value)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_FOUND_Member); |
|
|
|
} |
|
|
|
//角色对谁不可见
|
|
|
|
String[] excludeRoleCells; |
|
|
|
for (int i = memberStart + 1; i <= memberEnd; i++) { |
|
|
|