From b180708562d6fb872c83c05756e8041d9967483a Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期一, 22 十二月 2025 21:04:13 +0800
Subject: [PATCH] 2025.12.22 1. 修改日任务统计接口,新增当天内整改问题数和48小时内整改问题数统计
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
index ccca225..add0297 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -13,6 +13,7 @@
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.MediafileService
import cn.flightfeather.supervision.lightshare.service.ProblemlistService
+import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.service.TaskService
import cn.flightfeather.supervision.lightshare.vo.*
import com.fasterxml.jackson.core.type.TypeReference
@@ -39,6 +40,8 @@
val problemlistMapper: ProblemlistMapper,
val inspectionMapper: InspectionMapper,
val mediafileMapper: MediafileMapper,
+ private val subtaskService: SubtaskService,
+ private val subtaskMapper: SubtaskMapper,
private val taskRep: TaskRep,
private val subTaskRep: SubTaskRep,
private val problemRep: ProblemRep,
@@ -105,6 +108,42 @@
return problemListVolistTemp1
}
+ override fun getBySceneMonth(sceneId: String, year: Int?, month: Int?): Pair<List<SubtaskVo>, List<ProblemListVo>> {
+ var _year = year
+ var _month = month
+ var lastSubTasks = listOf<SubtaskVo>()
+ if (year == null) {
+ lastSubTasks = subtaskService.findByDate(sceneId = sceneId)
+// PageHelper.startPage<Problemlist>(1, 1)
+// val lastProblem = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
+// createCriteria().andEqualTo("sguid", sceneId)
+// orderBy("time").desc()
+// }).takeIf { it.isNotEmpty() }?.get(0)
+ if (lastSubTasks.isEmpty()) {
+ return lastSubTasks to emptyList()
+ } else {
+ val lt = LocalDateTime.ofInstant(lastSubTasks[0].planstarttime?.toInstant(), ZoneId.systemDefault())
+ _year = lt.year
+ _month = lt.monthValue
+ }
+ }
+ val sT = LocalDateTime.of(_year!!, _month!!, 1, 0, 0, 0, 0)
+ val eT = sT.plusMonths(1).minusSeconds(1)
+ if (lastSubTasks.isEmpty()) {
+ lastSubTasks = subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
+ createCriteria().andBetween("planstarttime", sT, eT)
+ }).map {
+ SubtaskVo().apply { BeanUtils.copyProperties(it, this) }
+ }
+ }
+ val problemList = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
+ createCriteria().andBetween("time", sT,eT)
+ .andEqualTo("sguid", sceneId)
+ orderBy("time").desc()
+ }).map { ProblemListVo().apply { BeanUtils.copyProperties(it, this) } }
+ return lastSubTasks to problemList
+ }
+
//鑾峰彇鏌愰《灞備换鍔′笅锛屾煇涓満鏅笅鐨勯棶棰樻暣鏀规儏鍐�
override fun getStatisticalResultById(topTaskId: String, sceneTypeId: String): List<StatisticsVo> {
val map = problemlistMapper.getStatisticalResultById(topTaskId, sceneTypeId)
--
Gitblit v1.9.3