From 0392c333ed3d987cb2ab3dac4e1a972cff405f21 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 25 四月 2024 17:42:08 +0800
Subject: [PATCH] 1. 新增后台任务关联模块 2. 新增自动评分后台任务; 3. 修复部分bug

---
 src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
index 8dba496..58db4df 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
@@ -1,19 +1,20 @@
 package cn.flightfeather.supervision.domain.ds1.repository
 
+import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion
 import cn.flightfeather.supervision.domain.ds1.entity.Task
+import cn.flightfeather.supervision.domain.ds1.mapper.MonitorobjectversionMapper
 import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper
 import cn.flightfeather.supervision.lightshare.vo.AreaVo
 import org.springframework.stereotype.Repository
-import java.time.LocalDate
 import java.time.ZoneId
 import java.util.*
 
 @Repository
-class TaskRep(private val taskMapper: TaskMapper) {
+class TaskRep(private val taskMapper: TaskMapper, private val monitorobjectversionMapper: MonitorobjectversionMapper) {
 
     private fun exampleTask(areaVo: AreaVo): Task?{
         areaVo.starttime ?: return null
-        val mStart = LocalDate.parse(areaVo.starttime).withDayOfMonth(1).atStartOfDay()
+        val mStart = areaVo.starttime!!.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
         val mEnd = mStart.plusMonths(1).minusSeconds(1)
         return Task().apply {
             provincecode = areaVo.provincecode
@@ -35,4 +36,12 @@
         val example = exampleTask(areaVo) ?: return emptyList()
         return taskMapper.select(example)
     }
+
+    /**
+     * 鑾峰彇鎬讳换鍔″搴旂殑鐩戠鐗堟湰
+     */
+    fun findMonitorList(taskId: String, sceneTypeId:String?): List<Monitorobjectversion> {
+        val monitorList = monitorobjectversionMapper.findMonitorListByScene(taskId, sceneTypeId)
+        return monitorList.sortedBy { it.displayid }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3