From 0f7b47105d80fb9a260486270cf925a232e74791 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期一, 22 十二月 2025 21:20:13 +0800
Subject: [PATCH] 2025.12.22 1. 修改日任务统计接口,新增当天内整改问题数和48小时内整改问题数统计
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
index 7fd361b..aee2d25 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -21,6 +21,8 @@
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
+import java.time.LocalDateTime
+import java.time.ZoneId
import java.util.*
import kotlin.collections.ArrayList
@@ -405,20 +407,34 @@
this.totalProblemNum += proList.size.toDouble() / ids.size
this.changedProblemNum += proList.filter { it.ischanged == true }.size.toDouble() / ids.size
this.changedProblemNumOnTime += proList.filter {
+ // 鏄惁鍦ㄥ悓涓�澶╁唴鏁存敼
+ val _changedDate = it.changedtime?.let { c->
+ LocalDateTime.ofInstant(c.toInstant(), ZoneId.systemDefault()).toLocalDate()
+ }
+ val _proDate = it.time?.let { t->
+ LocalDateTime.ofInstant(t.toInstant(), ZoneId.systemDefault()).toLocalDate()
+ }
+ val isSameDay = _changedDate?.equals(_proDate)
+ it.ischanged == true && (isSameDay ?: false)
+ }.size.toDouble() / ids.size
+ this.efficientChangedProNum += proList.filter {
// 鏁存敼鑰楁椂锛堝ぉ锛�
val day = ((it.changedtime?.time ?: 0L) - (it?.time?.time ?: 0L)).div(1000 * 60 * 60 * 24)
- it.ischanged == true && day <= 1
+ it.ischanged == true && day <= 2
}.size.toDouble() / ids.size
// 姝ゅ鍏堢疮璁″贰鏌ユ椂闀匡紝鏈�鍚庡啀鏍规嵁浠诲姟鏁伴噺骞冲潎
- this.avgInspectionTime +=
- ((fst.executionendtime?.time ?: 0L) - (fst.executionstarttime?.time ?: 0L)).div(1000).div(ids.size)
+ this.avgInspectionTime += if (fst.executionendtime == null || fst.executionstarttime == null) {
+ 0
+ } else {
+ (fst.executionendtime!!.time - fst.executionstarttime!!.time).div(1000).div(ids.size)
+ }
}
}
}
// 缁熶竴璁$畻骞冲潎宸℃煡鏃堕暱锛堢锛�
userProgressMap.forEach { (t, u) ->
- u.avgInspectionTime = (u.avgInspectionTime / u.completeTaskNum).toLong()
+ u.avgInspectionTime = if (u.completeTaskNum == .0 ) 0 else (u.avgInspectionTime / u.completeTaskNum).toLong()
u.formatParam()
}
--
Gitblit v1.9.3