From 4e20a1aaaba1bb843820fca844c20055a33febce Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 19 七月 2024 17:39:19 +0800 Subject: [PATCH] 1. 新增webSocket相关功能 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt | 39 ++++++++++++++++++++++++++++++++++----- 1 files changed, 34 insertions(+), 5 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 cb7885b..7853af7 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 @@ -9,10 +9,7 @@ import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.common.utils.DateUtil import cn.flightfeather.supervision.domain.ds1.repository.TaskRep -import cn.flightfeather.supervision.lightshare.service.EvaluationService -import cn.flightfeather.supervision.lightshare.service.SubtaskService -import cn.flightfeather.supervision.lightshare.service.TaskService -import cn.flightfeather.supervision.lightshare.service.UserinfoService +import cn.flightfeather.supervision.lightshare.service.* import cn.flightfeather.supervision.lightshare.vo.* import org.springframework.beans.BeanUtils import org.springframework.beans.factory.annotation.Autowired @@ -22,7 +19,10 @@ import kotlin.collections.ArrayList @Service -class TaskServiceImpl(val taskMapper: TaskMapper, private val taskRep: TaskRep,) : TaskService { +class TaskServiceImpl( + val taskMapper: TaskMapper, + private val taskRep: TaskRep, +) : TaskService { @Autowired lateinit var subtaskService: SubtaskService @@ -729,4 +729,33 @@ override fun findTask(areaVo: AreaVo): List<Task?> { return taskRep.findTasks(areaVo) } + + override fun findTaskProgress(areaVo: AreaVo): List<TaskProgressVo?> { + val res = mutableListOf<TaskProgressVo?>() + taskRep.findTasks(areaVo).forEach {t-> + if (t?.tguid == null) return@forEach + val pro = TaskProgressVo().apply { + tguid = t.tguid + name = t.name + levelnum = t.levelnum + provinceCode = t.provincecode + provinceName = t.provincename + cityCode = t.citycode + cityName = t.cityname + districtCode = t.districtcode + districtName = t.districtname + townCode = t.towncode + townName = t.townname + var count = 0 + taskRep.findMonitorList(t.tguid!!, areaVo.scensetypeid).forEach { + val c = if (it.extension1 != null) it.extension1!!.toInt() else 1 + count += c + } + totaltask = count + completetask = subtaskService.getSummary(t.tguid!!, areaVo.scensetypeid?.toIntOrNull()).size + } + res.add(pro) + } + return res + } } \ No newline at end of file -- Gitblit v1.9.3