From 0392c333ed3d987cb2ab3dac4e1a972cff405f21 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 25 四月 2024 17:42:08 +0800 Subject: [PATCH] 1. 新增后台任务关联模块 2. 新增自动评分后台任务; 3. 修复部分bug --- src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt index 022941c..7853af7 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt @@ -8,10 +8,8 @@ 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 @@ -21,7 +19,10 @@ 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 @@ -222,7 +223,7 @@ // example.or( example.createCriteria().andIsNull("tsguid") .andEqualTo("districtcode", districtCode) - .andLessThan("starttime", date) + .andLessThanOrEqualTo("starttime", date) .andGreaterThanOrEqualTo("endtime", date) // ) example.orderBy("starttime").desc() @@ -506,7 +507,7 @@ val criteria = example.createCriteria() //鑾峰彇鐢ㄦ埛淇℃伅 val userInfo = userinfoMapper.findOne(guid) - val districtCode = userInfo.dGuid + val districtCode = userInfo?.dGuid //娣诲姞鏃ユ湡杩囨护 @@ -725,4 +726,36 @@ 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 + } } \ No newline at end of file -- Gitblit v1.9.3