【fix sonar】SysDepartServiceImpl文件

This commit is contained in:
梁琦涛
2023-03-10 15:26:26 +08:00
parent ed98ead5aa
commit 77bb1b1003
@@ -73,7 +73,6 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
}
// 调用wrapTreeDataToTreeList方法生成树状数据
// List<SysDepartTreeModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToTreeList(listDepts);
return FindsDepartsChildrenUtil.wrapTreeDataToTreeList(listDepts);
}
@@ -88,7 +87,6 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
query.orderByAsc(SysDepart::getDepartOrder);
List<SysDepart> list = this.list(query);
// 调用wrapTreeDataToTreeList方法生成树状数据
// List<SysDepartTreeModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToTreeList(list);
return FindsDepartsChildrenUtil.wrapTreeDataToTreeList(list);
}
@@ -100,7 +98,6 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
query.orderByAsc(SysDepart::getDepartOrder);
List<SysDepart> list = this.list(query);
// 调用wrapTreeDataToTreeList方法生成树状数据
// List<DepartIdModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToDepartIdTreeList(list);
return FindsDepartsChildrenUtil.wrapTreeDataToDepartIdTreeList(list);
}
@@ -136,10 +133,11 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
/**
* saveDepartData 的调用方法,生成部门编码和部门类型(作废逻辑)
* @deprecated
* @deprecated 不推荐
* @param parentId
* @return
*/
@Deprecated
private String[] generateOrgCode(String parentId) {
//update-begin--Author:Steve Date:20190201 for:组织机构添加数据代码调整
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<>();
@@ -400,7 +398,6 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
return new String[0];
}
String orgCode = this.getMyDeptParentNode(list);
// String[] codeArr = orgCode.split(",");
return orgCode.split(",");
}
@@ -486,11 +483,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
//TODO 异步树加载key拼接__+时间戳,以便于每次展开节点会刷新数据
treeModel.setKey(treeModel.getKey());
Integer count=this.baseMapper.queryCountByPid(depart.getId());
if(count>0){
treeModel.setIsLeaf(false);
}else{
treeModel.setIsLeaf(true);
}
treeModel.setIsLeaf(count <= 0);
records.add(treeModel);
}
return records;