| | |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | import cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | |
| | | import kotlin.collections.ArrayList |
| | | |
| | | @Service |
| | | class TaskServiceImpl(val taskMapper: TaskMapper) : TaskService { |
| | | class TaskServiceImpl( |
| | | val taskMapper: TaskMapper, |
| | | private val taskRep: TaskRep, |
| | | ) : TaskService { |
| | | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | |
| | | // example.or( |
| | | example.createCriteria().andIsNull("tsguid") |
| | | .andEqualTo("districtcode", districtCode) |
| | | .andLessThan("starttime", date) |
| | | .andLessThanOrEqualTo("starttime", date) |
| | | .andGreaterThanOrEqualTo("endtime", date) |
| | | // ) |
| | | example.orderBy("starttime").desc() |
| | |
| | | val criteria = example.createCriteria() |
| | | //获取用户信息 |
| | | val userInfo = userinfoMapper.findOne(guid) |
| | | val districtCode = userInfo.dGuid |
| | | val districtCode = userInfo?.dGuid |
| | | |
| | | //添加日期过滤 |
| | | |
| | |
| | | return taskProgressVolist |
| | | } |
| | | |
| | | override fun findTask(areaVo: AreaVo): List<Task?> { |
| | | return taskRep.findTasks(areaVo) |
| | | } |
| | | |
| | | override fun findTaskProgress(areaVo: AreaVo): List<TaskProgressVo?> { |
| | | val res = mutableListOf<TaskProgressVo?>() |
| | | taskRep.findTasks(areaVo).forEach {t-> |
| | | if (t?.tguid == null) return@forEach |
| | | val pro = TaskProgressVo().apply { |
| | | tguid = t.tguid |
| | | name = t.name |
| | | levelnum = t.levelnum |
| | | provinceCode = t.provincecode |
| | | provinceName = t.provincename |
| | | cityCode = t.citycode |
| | | cityName = t.cityname |
| | | districtCode = t.districtcode |
| | | districtName = t.districtname |
| | | townCode = t.towncode |
| | | townName = t.townname |
| | | var count = 0 |
| | | taskRep.findMonitorList(t.tguid!!, areaVo.scensetypeid).forEach { |
| | | val c = if (it.extension1 != null) it.extension1!!.toInt() else 1 |
| | | count += c |
| | | } |
| | | totaltask = count |
| | | completetask = subtaskService.getSummary(t.tguid!!, areaVo.scensetypeid?.toIntOrNull()).size |
| | | } |
| | | res.add(pro) |
| | | } |
| | | return res |
| | | } |
| | | } |