Kaynağa Gözat

Merge branch 'master' of https://git.2fi-solutions.com/davidhui/TSMS-backend

tags/Baseline_30082024_BACKEND_UAT
MSI\2Fi 1 yıl önce
ebeveyn
işleme
cb71da89ee
2 değiştirilmiş dosya ile 15 ekleme ve 5 silme
  1. +13
    -3
      src/main/java/com/ffii/tsms/modules/data/service/SalaryEffectiveService.kt
  2. +2
    -2
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 13
- 3
src/main/java/com/ffii/tsms/modules/data/service/SalaryEffectiveService.kt Dosyayı Görüntüle

@@ -159,8 +159,10 @@ open class SalaryEffectiveService(

open fun getMonthlyStaffSalaryData(startDate: LocalDate, endDate: LocalDate): List<MonthlyStaffSalaryData> {
val salaryEffective = salaryEffectiveRepository.findAll()
.groupBy { Pair(it.date.year, it.date.month) }
.map { (_, se) -> se.maxByOrNull { it.date }!!}
.groupBy { Triple(it.staff.id, it.date.year, it.date.month) }
.map { (_, se) ->
se.maxByOrNull { it.date }!!
}
salaryEffective.sortedWith(compareBy({it.staff.staffId}, {it.date}))

val staffs = staffRepository.findAll().sortedBy { it.staffId }.filter { it.deleted == false }
@@ -168,15 +170,23 @@ open class SalaryEffectiveService(
val result = mutableListOf<MonthlyStaffSalaryData>()
val dateList = (0..ChronoUnit.MONTHS.between(startDate, endDate)).map { startDate.withDayOfMonth(1).plusMonths(it) }

// logger.info(dateList)
staffs.forEach { staff ->
dateList.forEach{ date ->
val staffSalaryEffective = salaryEffective.filter { it.staff.staffId.equals(staff.staffId) }
var currentHourlyRate = staffSalaryEffective.filter { date.isEqual(it.date.withDayOfMonth(1)) || date.isAfter(it.date.withDayOfMonth(1)) }.minByOrNull { it.date }

var currentHourlyRate = staffSalaryEffective.filter {
date.isEqual(it.date.withDayOfMonth(1)) || date.isAfter(it.date.withDayOfMonth(1))
}.maxByOrNull { it.date }

if (currentHourlyRate == null) {
currentHourlyRate = staffSalaryEffective.minByOrNull { it.date }
}

// if (staff.staffId == "B374") {
// logger.info("date:${date} | hourlyRate:${currentHourlyRate?.salary?.hourlyRate}")
// }

result += MonthlyStaffSalaryData(
staff = staff,
date = date,


+ 2
- 2
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Dosyayı Görüntüle

@@ -769,12 +769,12 @@ open class ReportService(
rowIndex = 10
sheet.getRow(rowIndex).apply {
createCell(1).apply {
setCellValue(if (project.expectedTotalFee != null) project.expectedTotalFee!! * 0.8 else 0.0)
setCellValue(if (project.expectedTotalFee != null) (project.expectedTotalFee!! - (project.subContractFee ?: 0.0)) * 0.8 else 0.0)
cellStyle.dataFormat = accountingStyle
}

createCell(2).apply {
setCellValue(project.expectedTotalFee ?: 0.0)
setCellValue((project.expectedTotalFee ?: 0.0) - (project.subContractFee ?: 0.0))
cellStyle.dataFormat = accountingStyle
}
}


Yükleniyor…
İptal
Kaydet