【fix sonar】SysBaseApiImpl文件

This commit is contained in:
梁琦涛
2023-03-08 17:53:30 +08:00
parent c4e0377377
commit d366f83f8c
@@ -758,7 +758,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
@NotNull @NotNull
private String getOrgCodes(List<SysUserDepart> userDepartList) { private String getOrgCodes(List<SysUserDepart> userDepartList) {
String orgCodes = ""; StringBuilder orgCodes = new StringBuilder();
for(SysUserDepart userDepart : userDepartList){ for(SysUserDepart userDepart : userDepartList){
//查询所属公司编码 //查询所属公司编码
SysDepart depart = sysDepartService.getById(userDepart.getDepId()); SysDepart depart = sysDepartService.getById(userDepart.getDepId());
@@ -766,12 +766,12 @@ public class SysBaseApiImpl implements ISysBaseAPI {
String compyOrgCode = ""; String compyOrgCode = "";
if(depart != null && depart.getOrgCode() != null){ if(depart != null && depart.getOrgCode() != null){
compyOrgCode = depart.getOrgCode().substring(0,length); compyOrgCode = depart.getOrgCode().substring(0,length);
if(!orgCodes.contains(compyOrgCode)){ if(!orgCodes.toString().contains(compyOrgCode)){
orgCodes = orgCodes + "," + compyOrgCode; orgCodes.append(",").append(compyOrgCode);
} }
} }
} }
return orgCodes; return orgCodes.toString();
} }
/** /**