Pārlūkot izejas kodu

remove contains

master
MSI\derek pirms 11 stundām
vecāks
revīzija
994b523ae7
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. +1
    -2
      src/main/java/com/ffii/tsms/modules/project/service/ProjectsService.kt

+ 1
- 2
src/main/java/com/ffii/tsms/modules/project/service/ProjectsService.kt Parādīt failu

@@ -500,9 +500,8 @@ open class ProjectsService(
open fun allBuildingTypes(): List<BuildingType> {
val sortedBuildingType = buildingTypeRepository.findAll().sortedBy { it.name }.sortedWith { a, b ->
when {
a.contains("Hidden", ignoreCase = true) && !b.contains("Hidden", ignoreCase = true) -> 2
a.startsWith("Others") && !b.startsWith("Others") -> 1 // Move "Others" to the end
(!a.startsWith("Others") && b.startsWith("Others")) || (!a.contains("Hidden", ignoreCase = true) && b.contains("Hidden", ignoreCase = true)) -> -1 // Keep non-"Others" items above
(!a.startsWith("Others") && b.startsWith("Others")) -> -1 // Keep non-"Others" items above
else -> 0 // Maintain relative order for other items
}
}


Notiek ielāde…
Atcelt
Saglabāt