|
|
@@ -380,24 +380,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
WbsTreeContract::getNodeName,
|
|
|
(existing, replacement) -> replacement // 如果键重复,保留后者
|
|
|
));
|
|
|
- StringBuilder result = new StringBuilder("");
|
|
|
+ List<String> result = new ArrayList<>();
|
|
|
for (Integer i : index) {
|
|
|
- if(i==0){
|
|
|
- if(map.containsKey(1)){
|
|
|
- result.append(map.get(1));
|
|
|
- }
|
|
|
- }
|
|
|
- else if(i==1){
|
|
|
- if(map.containsKey(18)){
|
|
|
- result.append(map.get(18));
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(map.containsKey(i)){
|
|
|
- result.append(map.get(i));
|
|
|
- }
|
|
|
+ String title = map.get(i == 0 ? 1 : i == 1 && map.containsKey(18) ? 18 : i);
|
|
|
+ if(title == null || result.stream().anyMatch(f -> f.contains(title))){
|
|
|
+ continue;
|
|
|
}
|
|
|
+ result.add(title);
|
|
|
}
|
|
|
- return result.toString();
|
|
|
+ return String.join("", result);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/previewNodeName")
|