瀏覽代碼

remove contains

master
MSI\derek 4 小時之前
父節點
當前提交
994b523ae7
共有 1 個文件被更改,包括 1 次插入2 次删除
  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 查看文件

@@ -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
}
}


Loading…
取消
儲存