fun getLatestCodeNumberByMainProject(isClpProject: Boolean, id: Serializable?): Long?
@Query("SELECT max(cast(substring_index(p.code, '-', -1) as long)) FROM Project p WHERE p.code like ?1 and p.id != ?2")
@Query("SELECT max(case when length(p.code) - length(replace(p.code, '-', '')) > 1 then cast(substring_index(p.code, '-', -1) as long) end) FROM Project p WHERE p.code like ?1 and p.id != ?2")
fun getLatestCodeNumberBySubProject(code: String, id: Serializable?): Long?
fun findAllByStatusIsNotAndMainProjectIsNull(status: String): List<Project>
+ 3- 0
src/main/java/com/ffii/tsms/modules/project/entity/projections/ProjectSearchInfo.ktVoir le fichier
@@ -11,6 +11,9 @@ interface ProjectSearchInfo {
val code: String?
val status: String?
@get:Value("#{target.mainProject?.code}")
val mainProject: String?
@get:Value("#{target.projectCategory.name}")
val category: String?
+ 10- 6
src/main/java/com/ffii/tsms/modules/project/service/ProjectsService.ktVoir le fichier
@@ -210,6 +210,8 @@ open class ProjectsService(
custLeadPhone =
if (request.isSubsidiaryContact == null || !request.isSubsidiaryContact) clientContact.phone else subsidiaryContact.phone
this.customerSubsidiary = customerSubsidiary
this.customerContact = if (customerSubsidiary == null) clientContact else null
this.subsidiaryContact = if (customerSubsidiary != null) subsidiaryContact else null
}
@@ -325,11 +327,11 @@ open class ProjectsService(
val project = projectRepository.findById(projectId)
return project.getOrNull()?.let {
val subsidiaryContact = it.customerSubsidiary?.id?.let { subsidiaryId ->