【fix sonar】 FindsDepartsChildrenUtil.java文件
This commit is contained in:
+7
-3
@@ -18,6 +18,10 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class FindsDepartsChildrenUtil {
|
public class FindsDepartsChildrenUtil {
|
||||||
|
|
||||||
|
private FindsDepartsChildrenUtil(){}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queryTreeList的子方法 ====1=====
|
* queryTreeList的子方法 ====1=====
|
||||||
* 该方法是s将SysDepart类型的list集合转换成SysDepartTreeModel类型的集合
|
* 该方法是s将SysDepart类型的list集合转换成SysDepartTreeModel类型的集合
|
||||||
@@ -25,7 +29,7 @@ public class FindsDepartsChildrenUtil {
|
|||||||
public static List<SysDepartTreeModel> wrapTreeDataToTreeList(List<SysDepart> recordList) {
|
public static List<SysDepartTreeModel> wrapTreeDataToTreeList(List<SysDepart> recordList) {
|
||||||
// 在该方法每请求一次,都要对全局list集合进行一次清理
|
// 在该方法每请求一次,都要对全局list集合进行一次清理
|
||||||
//idList.clear();
|
//idList.clear();
|
||||||
List<DepartIdModel> idList = new ArrayList<DepartIdModel>();
|
List<DepartIdModel> idList = new ArrayList<>();
|
||||||
List<SysDepartTreeModel> records = new ArrayList<>();
|
List<SysDepartTreeModel> records = new ArrayList<>();
|
||||||
for (int i = 0; i < recordList.size(); i++) {
|
for (int i = 0; i < recordList.size(); i++) {
|
||||||
SysDepart depart = recordList.get(i);
|
SysDepart depart = recordList.get(i);
|
||||||
@@ -47,7 +51,7 @@ public class FindsDepartsChildrenUtil {
|
|||||||
public static List<DepartIdModel> wrapTreeDataToDepartIdTreeList(List<SysDepart> recordList) {
|
public static List<DepartIdModel> wrapTreeDataToDepartIdTreeList(List<SysDepart> recordList) {
|
||||||
// 在该方法每请求一次,都要对全局list集合进行一次清理
|
// 在该方法每请求一次,都要对全局list集合进行一次清理
|
||||||
//idList.clear();
|
//idList.clear();
|
||||||
List<DepartIdModel> idList = new ArrayList<DepartIdModel>();
|
List<DepartIdModel> idList = new ArrayList<>();
|
||||||
List<SysDepartTreeModel> records = new ArrayList<>();
|
List<SysDepartTreeModel> records = new ArrayList<>();
|
||||||
for (int i = 0; i < recordList.size(); i++) {
|
for (int i = 0; i < recordList.size(); i++) {
|
||||||
SysDepart depart = recordList.get(i);
|
SysDepart depart = recordList.get(i);
|
||||||
@@ -115,7 +119,7 @@ public class FindsDepartsChildrenUtil {
|
|||||||
|
|
||||||
for (int i = 0; i < treeList.size(); i++) {
|
for (int i = 0; i < treeList.size(); i++) {
|
||||||
SysDepartTreeModel model = treeList.get(i);
|
SysDepartTreeModel model = treeList.get(i);
|
||||||
if (model.getChildren().size() == 0) {
|
if (model.getChildren().isEmpty()) {
|
||||||
model.setChildren(null);
|
model.setChildren(null);
|
||||||
model.setIsLeaf(true);
|
model.setIsLeaf(true);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user