From 30a53b41f09d2eefd33513a409d472c2166ba1ea Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期三, 10 一月 2024 17:35:03 +0800 Subject: [PATCH] 1. 新增自动评估相关数据源的检查接口 --- src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt | 53 +++++++++++++++++++++++++++++------------------------ 1 files changed, 29 insertions(+), 24 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 3d715f9..063368b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt @@ -11,13 +11,9 @@ import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Component import tk.mybatis.mapper.entity.Example -import java.time.Duration import java.time.LocalDateTime import java.time.ZoneId -import javax.annotation.PostConstruct /** * 鎶ュ憡鎵�闇�婧愭暟鎹� @@ -49,11 +45,12 @@ } fun loop(callback: (index:Int, rowData: RowData) -> Unit) { - reset() +// reset() for (i in sourceList.indices) { +// rowData.recordLastScene() rowData.index = i - rowData.clear() rowData.subTask = sourceList[i] + rowData.clear() callback(i, rowData) } } @@ -72,7 +69,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.ScenseType.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)}" } /** @@ -113,7 +110,8 @@ } }) } else { - taskSceneIdList = dbMapper.monitorobjectversionMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode) + 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) @@ -126,11 +124,12 @@ for (s in subTaskList) { if (s.scenseid == it) { subtask = s - break + result.add(s) } } - if (subtask == null) subtask = Subtask().apply { scenseid = it } - result.add(subtask) + if (subtask == null) { + result.add(Subtask().apply { scenseid = it }) + } } } else { result.addAll(subTaskList) @@ -162,16 +161,16 @@ get() { if (_baseScene == null) { _baseScene = when (this.scene?.typeid.toString()) { - Constant.ScenseType.TYPE1.value -> { + Constant.SceneType.TYPE1.value -> { dbMapper.sceneConstructionSiteMapper.selectByPrimaryKey(scene?.guid) } - Constant.ScenseType.TYPE2.value -> { + Constant.SceneType.TYPE2.value -> { dbMapper.sceneWharfMapper.selectByPrimaryKey(scene?.guid) } - Constant.ScenseType.TYPE3.value -> { + Constant.SceneType.TYPE3.value -> { dbMapper.sceneMixingPlantMapper.selectByPrimaryKey(scene?.guid) } - Constant.ScenseType.TYPE14.value -> { + Constant.SceneType.TYPE14.value -> { dbMapper.sceneStorageYardMapper.selectByPrimaryKey(scene?.guid) } else -> null @@ -305,7 +304,7 @@ val ledgerCount: Int get() { if (_ledgerCount == -1) { - val tzSceneType = Constant.ScenseType.typeMap(scene?.typeid) + val tzSceneType = Constant.SceneType.typeMap(scene?.typeid) _ledgerCount = dbMapper.ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply { createCriteria().andEqualTo("lScenetype", tzSceneType).andEqualTo("lNeedupdate", true) }) @@ -359,23 +358,29 @@ } /** + * 璁板綍涓婁竴涓満鏅� + */ + fun recordLastScene() { + lastScene = scene + } + + /** * 娓呯┖褰撳墠澶勭悊鐨勫璞$殑鐩稿叧鏁版嵁婧� */ fun clear() { - if (lastScene != null && lastScene?.typeid != _scene?.typeid) { - _problemTypes.clear() - _topItems.clear() - _rules.clear() - _ledgerCount = -1 - } else { - lastScene = _scene - } _scene = null _baseScene = null _problems.clear() _evaluation = null _itemevaluationList.clear() _ledgerRecordNum = null + if (lastScene != null && lastScene?.typeid != scene?.typeid) { + _problemTypes.clear() + _topItems.clear() + _rules.clear() + _ledgerCount = -1 + } + recordLastScene() } /** -- Gitblit v1.9.3