Browse Source

update

tags/Baseline_30082024_BACKEND_UAT
MSI\derek 1 year ago
parent
commit
d590f0923c
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 5
- 5
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt View File

@@ -2094,10 +2094,10 @@ open class ReportService(
+ " sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 as budgetConsumptionRate, " + " sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 as budgetConsumptionRate, "
+ " sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0) as manhourConsumptionRate, " + " sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0) as manhourConsumptionRate, "
+ " case " + " case "
+ " when (sum(t.consumedBudget) / p.expectedTotalFee) >= :lowerLimit and (sum(t.consumedBudget) / p.expectedTotalFee) <= 1 "
+ " when sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 >= :lowerLimit and sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 <= 1 "
+ " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit and (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) <= 1 " + " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit and (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) <= 1 "
+ " then 'Potential Overconsumption' " + " then 'Potential Overconsumption' "
+ " when (sum(t.consumedBudget) / p.expectedTotalFee) >= 1 "
+ " when sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 >= 1 "
+ " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= 1 " + " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= 1 "
+ " then 'Overconsumption' " + " then 'Overconsumption' "
+ " else 'Within Budget' " + " else 'Within Budget' "
@@ -2127,13 +2127,13 @@ open class ReportService(
if (args.containsKey("status")) if (args.containsKey("status"))
statusFilter = when (args.get("status")) { statusFilter = when (args.get("status")) {
"Potential Overconsumption" -> " having " + "Potential Overconsumption" -> " having " +
" (sum(t.consumedBudget) / p.expectedTotalFee) >= :lowerLimit " +
" and (sum(t.consumedBudget) / p.expectedTotalFee) <= 1 " +
" sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 >= :lowerLimit " +
" and sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 <= 1 " +
" or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit " + " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit " +
" and (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) <= 1 " " and (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) <= 1 "


"All" -> " having " + "All" -> " having " +
" (sum(t.consumedBudget) / p.expectedTotalFee) >= :lowerLimit " +
" sum(t.consumedBudget) / (p.expectedTotalFee - ifnull(p.subContractFee, 0)) * 0.8 >= :lowerLimit " +
" or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit " " or (sum(t.normalConsumed + COALESCE(t.otConsumed, 0)) / COALESCE(p.totalManhour, 0)) >= :lowerLimit "


else -> "" else -> ""


Loading…
Cancel
Save