From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 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 70db70c..f103925 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
@@ -10,6 +10,7 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.common.utils.UUIDGenerator
+import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.*
@@ -26,6 +27,7 @@
val taskMapper: TaskMapper,
private val taskRep: TaskRep,
private val subTaskRep: SubTaskRep,
+ private val sceneRep: SceneRep,
) : TaskService {
@Autowired
@@ -766,14 +768,33 @@
districtName = t.districtname
townCode = t.towncode
townName = t.townname
+
var count = 0
+ val countByScene = mutableMapOf<String?, Int>()
+ val allScenes = sceneRep.findSceneList(t.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode)
taskRep.findMonitorList(t.tguid!!, areaVo.scensetypeid).forEach {
- val c = if (it.extension1 != null) it.extension1!!.toInt() else 1
+ val c = it.monitornum ?: 1
count += c
+
+ allScenes.find { s-> s?.guid == it.sguid }?.let { s->
+// if (!countByScene.containsKey(s.type)) {
+// countByScene[s.type] = 0
+// }
+ countByScene[s.type] = (countByScene[s.type] ?: 0) + c
+ }
}
totaltask = count
- subTaskSummary = subTaskRep.findSummary(areaVo)
+ totaltaskByScene = countByScene
+
+ subTaskSummary = subTaskRep.findSummary(AreaVo().apply {
+ topTaskId = t.tguid
+ })
+ val completeByScene = mutableMapOf<String?, Int>()
+ subTaskSummary?.forEach {
+ completeByScene[it.sceneType] = (completeByScene[it.sceneType] ?: 0) + 1
+ }
completetask = this.subTaskSummary?.size
+ completetaskByScene = completeByScene
}
res.add(pro)
}
--
Gitblit v1.9.3