|
@@ -384,31 +384,28 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
|
|
|
Long schoolId = sysUser.getSchoolId();
|
|
|
SysOrg sysOrg = this.findRootOrg(schoolId);
|
|
|
- Long parentId = sysOrg.getId();
|
|
|
+ Long rootParentId = sysOrg.getId();
|
|
|
Map<String, Long> map = new HashMap<>();
|
|
|
for (String orgInfo : orgInfoList) {
|
|
|
-
|
|
|
-
|
|
|
+ Long parentId = rootParentId;
|
|
|
String[] arr = orgInfo.split(SystemConstant.ORG_SPLIT);
|
|
|
for (int i = 0; i < arr.length; i++) {
|
|
|
SysOrg targetOrg;
|
|
|
- String orgDetailName = "";
|
|
|
+ StringBuilder orgDetailName = new StringBuilder();
|
|
|
String orgName = arr[i];
|
|
|
|
|
|
|
|
|
for (int j = 0; j <= i; j++) {
|
|
|
- orgDetailName = orgDetailName + arr[j] + SystemConstant.ORG_SPLIT;
|
|
|
+ orgDetailName.append(arr[j]).append(SystemConstant.ORG_SPLIT);
|
|
|
}
|
|
|
if (orgDetailName.length() > 0) {
|
|
|
- orgDetailName = orgDetailName.substring(0, orgDetailName.length() - SystemConstant.ORG_SPLIT.length());
|
|
|
+ orgDetailName = new StringBuilder(
|
|
|
+ orgDetailName.substring(0, orgDetailName.length() - SystemConstant.ORG_SPLIT.length()));
|
|
|
}
|
|
|
- if (!map.containsKey(orgDetailName)) {
|
|
|
+ if (!map.containsKey(orgDetailName.toString())) {
|
|
|
|
|
|
- targetOrg = this.getOne(new QueryWrapper<SysOrg>()
|
|
|
- .lambda()
|
|
|
- .eq(SysOrg::getSchoolId, schoolId)
|
|
|
- .eq(SysOrg::getName, orgName)
|
|
|
- .eq(SysOrg::getParentId, parentId));
|
|
|
+ targetOrg = this.getOne(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId)
|
|
|
+ .eq(SysOrg::getName, orgName).eq(SysOrg::getParentId, parentId));
|
|
|
|
|
|
|
|
|
if (Objects.isNull(targetOrg)) {
|
|
@@ -416,12 +413,12 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
}
|
|
|
|
|
|
|
|
|
- map.put(orgDetailName, targetOrg.getId());
|
|
|
+ map.put(orgDetailName.toString(), targetOrg.getId());
|
|
|
|
|
|
parentId = targetOrg.getId();
|
|
|
} else {
|
|
|
|
|
|
- parentId = map.get(orgDetailName);
|
|
|
+ parentId = map.get(orgDetailName.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|