| | |
| | | */ |
| | | class DataSource(val config: ExcelConfigVo, val dbMapper: DbMapper){ |
| | | |
| | | private val dateUtil = DateUtil() |
| | | |
| | | private val sourceList = mutableListOf<Subtask>() |
| | | |
| | | var year = 0 |
| | |
| | | */ |
| | | 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)}" |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | //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) } |
| | |
| | | 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) |
| | | }) |
| | | } |
| | | |