| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.MonitorobjectversionMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.springframework.stereotype.Repository |
| | | import java.time.LocalDate |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class TaskRep(private val taskMapper: TaskMapper) { |
| | | class TaskRep(private val taskMapper: TaskMapper, private val monitorobjectversionMapper: MonitorobjectversionMapper) { |
| | | |
| | | private fun exampleTask(areaVo: AreaVo): Task?{ |
| | | areaVo.starttime ?: return null |
| | | val mStart = LocalDate.parse(areaVo.starttime).withDayOfMonth(1).atStartOfDay() |
| | | val mStart = areaVo.starttime!!.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | | val mEnd = mStart.plusMonths(1).minusSeconds(1) |
| | | return Task().apply { |
| | | provincecode = areaVo.provincecode |
| | |
| | | val example = exampleTask(areaVo) ?: return emptyList() |
| | | return taskMapper.select(example) |
| | | } |
| | | |
| | | /** |
| | | * 获取总任务对应的监管版本 |
| | | */ |
| | | fun findMonitorList(taskId: String, sceneTypeId:String?): List<Monitorobjectversion> { |
| | | val monitorList = monitorobjectversionMapper.findMonitorListByScene(taskId, sceneTypeId) |
| | | return monitorList.sortedBy { it.displayid } |
| | | } |
| | | } |