소스 검색

remove contains

master
MSI\derek 15 시간 전
부모
커밋
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
}
}


불러오는 중...
취소
저장