From 2ae8bf126599f68ba1ca721ff2acc1dd4461e9a5 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 12 九月 2023 11:05:47 +0800
Subject: [PATCH] 1. 整合了飞羽环境、徐汇油烟及金山扬尘两个数据库; 2. 优化重构自动评估模块逻辑; 3. 新增监测数据自动化统; 4. 将自动统计应用于自动评估中;

---
 src/test/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImplTest.kt |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImplTest.kt b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImplTest.kt
index 96dd876..568eb3d 100644
--- a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImplTest.kt
+++ b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImplTest.kt
@@ -1,6 +1,8 @@
 package cn.flightfeather.supervision.lightshare.service.impl
 
 import cn.flightfeather.supervision.SupervisionApplication
+import cn.flightfeather.supervision.domain.ds1.entity.Subtask
+import cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper
 import cn.flightfeather.supervision.lightshare.service.SearchService
 import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
 import org.junit.Test
@@ -12,6 +14,7 @@
 import org.springframework.test.context.junit.jupiter.SpringExtension
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
 import org.springframework.test.context.junit4.SpringRunner
+import tk.mybatis.mapper.entity.Example
 import java.time.LocalDateTime
 import java.time.ZoneId
 import java.util.*
@@ -24,6 +27,9 @@
     @Autowired
     lateinit var searchService: SearchService
 
+    @Autowired
+    lateinit var subtaskMapper: SubtaskMapper
+
     @Test
     fun getExcel() {
         val localTimeS = LocalDateTime.of(2021, 3, 1, 0, 0, 0)
@@ -31,14 +37,50 @@
         val sD = Date.from(localTimeS.atZone(ZoneId.systemDefault()).toInstant())
         val eD = Date.from(localTimeE.atZone(ZoneId.systemDefault()).toInstant())
 
-        val mode = 10
+        val mode = 9
         //閲戝北2022骞�6鏈�
         searchService.writeToFile(ExcelConfigVo(
-            "8QN1VzftuhBJmrF8",
+            "0kG5dblu1uPqo8qW",
             districtCode = "310106",
 //            townCode = "310116113",
             sceneType = 1), mode)
         //閲戝北2021骞�3鏈�
 //        searchService.writeToFile(ExcelConfigVo("o7jdSzr79fe0NH3I", districtCode = "310116", sceneType = 1))
     }
+
+    @Test
+    fun getDailyReport() {
+        val cal = Calendar.getInstance()
+        cal.set(2022, 10, 2, 0, 0, 0)
+        cal.set(Calendar.MILLISECOND, 0)
+        val sDate = cal.time
+        cal.add(Calendar.DAY_OF_MONTH, 1)
+        val eDate = cal.time
+        val r = searchService.getDailyReport(ExcelConfigVo(districtCode = "310116", startTime = sDate, endTime = eDate))
+        println(r)
+    }
+
+    @Test
+    fun foo1() {
+        val cal = Calendar.getInstance()
+        cal.set(2022, 10, 2, 0, 0, 0)
+        cal.set(Calendar.MILLISECOND, 0)
+        val sDate = cal.time
+        cal.add(Calendar.DAY_OF_MONTH, 1)
+        val eDate = cal.time
+        val config = ExcelConfigVo(districtCode = "310116", startTime = sDate, endTime = eDate)
+
+        val r = subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
+            createCriteria().apply {
+                if (config.subTaskIdList?.isNotEmpty() == true) {
+                    andIn("stguid", config.subTaskIdList)
+                }
+                config.startTime?.let { andEqualTo("planstarttime", it) }
+//                config.endTime?.let { andLessThanOrEqualTo("planendtime", it) }
+                config.districtCode?.let { andEqualTo("districtcode", it) }
+//                andEqualTo("tguid", config.topTaskGuid)
+            }
+        })
+        println(r)
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3