|
@@ -11,6 +11,7 @@ import com.ffii.tsms.modules.project.entity.Milestone |
|
|
import com.ffii.tsms.modules.project.entity.projections.InvoiceInfoSearchInfo |
|
|
import com.ffii.tsms.modules.project.entity.projections.InvoiceInfoSearchInfo |
|
|
import com.ffii.tsms.modules.project.entity.projections.InvoiceSearchInfo |
|
|
import com.ffii.tsms.modules.project.entity.projections.InvoiceSearchInfo |
|
|
import com.ffii.tsms.modules.project.web.models.* |
|
|
import com.ffii.tsms.modules.project.web.models.* |
|
|
|
|
|
import com.ffii.tsms.modules.timesheet.entity.TimesheetRepository |
|
|
import org.springframework.stereotype.Service |
|
|
import org.springframework.stereotype.Service |
|
|
import org.springframework.transaction.annotation.Transactional |
|
|
import org.springframework.transaction.annotation.Transactional |
|
|
import java.time.LocalDate |
|
|
import java.time.LocalDate |
|
@@ -39,7 +40,8 @@ open class ProjectsService( |
|
|
private val milestoneRepository: MilestoneRepository, |
|
|
private val milestoneRepository: MilestoneRepository, |
|
|
private val gradeAllocationRepository: GradeAllocationRepository, |
|
|
private val gradeAllocationRepository: GradeAllocationRepository, |
|
|
private val projectTaskRepository: ProjectTaskRepository, |
|
|
private val projectTaskRepository: ProjectTaskRepository, |
|
|
private val milestonePaymentRepository: MilestonePaymentRepository, private val taskGroupRepository: TaskGroupRepository |
|
|
|
|
|
|
|
|
private val milestonePaymentRepository: MilestonePaymentRepository, private val taskGroupRepository: TaskGroupRepository, |
|
|
|
|
|
private val timesheetRepository: TimesheetRepository |
|
|
) { |
|
|
) { |
|
|
open fun allProjects(): List<ProjectSearchInfo> { |
|
|
open fun allProjects(): List<ProjectSearchInfo> { |
|
|
return projectRepository.findProjectSearchInfoByOrderByCreatedDesc() |
|
|
return projectRepository.findProjectSearchInfoByOrderByCreatedDesc() |
|
@@ -80,7 +82,7 @@ open class ProjectsService( |
|
|
) }, |
|
|
) }, |
|
|
hoursAllocated = project.totalManhour ?: 0.0, |
|
|
hoursAllocated = project.totalManhour ?: 0.0, |
|
|
hoursAllocatedOther = 0.0, |
|
|
hoursAllocatedOther = 0.0, |
|
|
hoursSpent = 0.0, |
|
|
|
|
|
|
|
|
hoursSpent = timesheetRepository.totalNormalHoursConsumedByProject(project), |
|
|
hoursSpentOther = 0.0 |
|
|
hoursSpentOther = 0.0 |
|
|
) |
|
|
) |
|
|
} } |
|
|
} } |
|
|