| | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | |
| | | val taskMapper: TaskMapper, |
| | | private val taskRep: TaskRep, |
| | | private val subTaskRep: SubTaskRep, |
| | | private val sceneRep: SceneRep, |
| | | ) : TaskService { |
| | | |
| | | @Autowired |
| | |
| | | districtName = t.districtname |
| | | townCode = t.towncode |
| | | townName = t.townname |
| | | |
| | | var count = 0 |
| | | val countByScene = mutableMapOf<String?, Int>() |
| | | val allScenes = sceneRep.findSceneList(t.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode) |
| | | taskRep.findMonitorList(t.tguid!!, areaVo.scensetypeid).forEach { |
| | | val c = if (it.extension1 != null) it.extension1!!.toInt() else 1 |
| | | val c = it.monitornum ?: 1 |
| | | count += c |
| | | |
| | | allScenes.find { s-> s?.guid == it.sguid }?.let { s-> |
| | | // if (!countByScene.containsKey(s.type)) { |
| | | // countByScene[s.type] = 0 |
| | | // } |
| | | countByScene[s.type] = (countByScene[s.type] ?: 0) + c |
| | | } |
| | | } |
| | | totaltask = count |
| | | subTaskSummary = subTaskRep.findSummary(areaVo) |
| | | totaltaskByScene = countByScene |
| | | |
| | | subTaskSummary = subTaskRep.findSummary(AreaVo().apply { |
| | | topTaskId = t.tguid |
| | | }) |
| | | val completeByScene = mutableMapOf<String?, Int>() |
| | | subTaskSummary?.forEach { |
| | | completeByScene[it.sceneType] = (completeByScene[it.sceneType] ?: 0) + 1 |
| | | } |
| | | completetask = this.subTaskSummary?.size |
| | | completetaskByScene = completeByScene |
| | | } |
| | | res.add(pro) |
| | | } |