2025.12.22
1. 修改日任务统计接口,新增当天内整改问题数和48小时内整改问题数统计
已修改1个文件
9 ■■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -423,15 +423,18 @@
                            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()
            }