fix: 78645
体系搜索--弹窗中列表中的数据的默认排序未按需求文档中描述的进行排序
This commit is contained in:
+4
-1
@@ -51,6 +51,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -251,7 +252,9 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
sarMenuStandard.buildPathMap(pathMap, "");
|
||||
|
||||
// 为树设置systemSort
|
||||
SarMenuStandard.setSystemSort(sarMenuStandard, "");
|
||||
// SarMenuStandard.setSystemSort(sarMenuStandard, "");
|
||||
AtomicInteger currentNumber = new AtomicInteger(1);
|
||||
SarMenuStandard.setSystemSortDFS(sarMenuStandard, currentNumber);
|
||||
|
||||
// 国标外标标准状态字典
|
||||
List<TsDicType> gbStateDictList = dicItemService.selectAllDicTypeNameByDicCode("STANDSTATE");
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -218,4 +219,15 @@ public class SarMenuStandard extends BaseEntity {
|
||||
setSystemSort(child, currentSort);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增的深度优先遍历方法
|
||||
public static void setSystemSortDFS(SarMenuStandard node, AtomicInteger currentNumber) {
|
||||
if (node == null) {
|
||||
return;
|
||||
}
|
||||
node.setSystemSort(currentNumber.getAndIncrement());
|
||||
for (SarMenuStandard child : node.getChildren()) {
|
||||
setSystemSortDFS(child, currentNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user