From bda3bf8923acb5216f6f46b5d903cac24c842143 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期六, 28 九月 2024 22:25:29 +0800
Subject: [PATCH] 1. 新增监测数据得分批量更新接口(待完成)

---
 src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
index 2fd96af..f91d3f6 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
@@ -23,8 +23,6 @@
  */
 class DataSource(val config: ExcelConfigVo, val dbMapper: DbMapper){
 
-    private val dateUtil = DateUtil()
-
     private val sourceList = mutableListOf<Subtask>()
 
     var year = 0
@@ -70,7 +68,7 @@
      */
     fun areaName(): String {
         val t = dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid)
-        return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
+        return "${DateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
     }
 
     /**
@@ -96,14 +94,10 @@
 
         //1. 鏌ユ壘鐗瑰畾鐨勫贰鏌ヤ换鍔℃垨鑰呮墍鏈夌殑璁″垝宸℃煡浠诲姟
         var taskSceneIdList = listOf<String>()
-        val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true ||
-            (config.startTime != null || config.endTime != null)
-        ) {
+        val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true) {
             dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                 createCriteria().apply {
-                    if (config.subTaskIdList?.isNotEmpty() == true) {
-                        andIn("stguid", config.subTaskIdList)
-                    }
+                    andIn("stguid", config.subTaskIdList)
                     config.startTime?.let { andGreaterThanOrEqualTo("planstarttime", it) }
                     config.endTime?.let { andLessThanOrEqualTo("planendtime", it) }
                     config.districtCode?.let { andEqualTo("districtcode", it) }
@@ -114,8 +108,9 @@
             taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config
                 .sceneType, config.townCode).map { it.guid ?: "" }
             dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
-                createCriteria().andIn("scenseid", taskSceneIdList)
-                    .andEqualTo("tguid", config.topTaskGuid)
+                createCriteria().apply {
+                    if (taskSceneIdList.isNotEmpty()) andIn("scenseid", taskSceneIdList)
+                }.andEqualTo("tguid", config.topTaskGuid)
             })
         }
 

--
Gitblit v1.9.3