|
|
@@ -181,6 +181,7 @@ open class ProjectsService( |
|
|
|
.orElseThrow() else null |
|
|
|
val teamLead = staffRepository.findById(request.projectLeadId).orElseThrow() |
|
|
|
val customer = customerService.findCustomer(request.clientId) |
|
|
|
val customerType = request.clientTypeId?.let { customerService.findCustomerType(it) } ?: customer.customerType |
|
|
|
val subsidiaryContact = |
|
|
|
if (request.clientContactId != null) subsidiaryContactRepository.findById(request.clientContactId) |
|
|
|
.orElse(null) else null |
|
|
@@ -255,6 +256,7 @@ open class ProjectsService( |
|
|
|
this.customerSubsidiary = customerSubsidiary |
|
|
|
this.customerContact = if (customerSubsidiary == null) clientContact else null |
|
|
|
this.subsidiaryContact = if (customerSubsidiary != null) subsidiaryContact else null |
|
|
|
this.customerType = customerType |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -403,6 +405,7 @@ open class ProjectsService( |
|
|
|
buildingTypeIds = it.buildingTypes.mapNotNull { buildingType -> buildingType.id }, |
|
|
|
workNatureIds = it.workNatures.mapNotNull { workNature -> workNature.id }, |
|
|
|
clientId = it.customer?.id, |
|
|
|
clientTypeId = it.customerType?.id ?: it.customer?.customerType?.id, |
|
|
|
clientContactId = it.subsidiaryContact?.id ?: it.customerContact?.id, |
|
|
|
// subsidiaryContact.find { contact -> contact.name == it.custLeadName }?.id ?: customerContact.find { contact -> contact.name == it.custLeadName }?.id, |
|
|
|
clientSubsidiaryId = it.customerSubsidiary?.id, |
|
|
@@ -745,6 +748,7 @@ open class ProjectsService( |
|
|
|
valueTransform = { it.percentage!! } |
|
|
|
), |
|
|
|
projectActualEnd = null, |
|
|
|
clientTypeId = null, |
|
|
|
taskTemplateId = taskTemplate.id, |
|
|
|
taskGroups = taskGroups, |
|
|
|
milestones = mapOf( |
|
|
|