From c17e9978745cfe6c983f3aff75c9182fffef32fd Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 09 六月 2025 17:29:23 +0800
Subject: [PATCH] 1. 修复部分数据统计接口bug
---
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