| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.AutoScore2 |
| | | import cn.flightfeather.supervision.business.storage.StAutoScore |
| | | import cn.flightfeather.supervision.business.autooutput.AopTaskCtrl |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.common.executor.BgTaskType |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Domainitem |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.Domain |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.SubtaskVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | import kotlin.Comparator |
| | | |
| | | @Service |
| | | class EvaluationServiceImpl(val evaluationMapper: EvaluationMapper) : EvaluationService { |
| | | class EvaluationServiceImpl( |
| | | private val evaluationMapper: EvaluationMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val aopTaskCtrl: AopTaskCtrl, |
| | | ) : EvaluationService { |
| | | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | |
| | | @Autowired |
| | | lateinit var subtaskMapper: SubtaskMapper |
| | | @Autowired |
| | | lateinit var autoScore: StAutoScore |
| | | lateinit var aopEvaluation: AopEvaluation |
| | | private var isAutoScoreRunning = false |
| | | |
| | | //获取某顶层任务下某个场景的街道评分排名 |
| | |
| | | return areaVolist |
| | | } |
| | | |
| | | override fun getTopTaskByScene(sceneId: String?): String? { |
| | | val example = Example(Evaluation::class.java) |
| | | val criteria = example.createCriteria() |
| | | criteria.andEqualTo("sguid", sceneId) |
| | | example.orderBy("evaluatetime").desc() |
| | | val evaluationlist = evaluationMapper.selectByExample(example) |
| | | var subtask = SubtaskVo() |
| | | if (evaluationlist.isNotEmpty()) { |
| | | val stguid = evaluationlist[0].stguid |
| | | if (stguid != null) |
| | | subtask = subtaskService.findByID(stguid) |
| | | } |
| | | return subtask.tguid |
| | | } |
| | | |
| | | override fun autoScore(districtCode: String, time: String): List<String> { |
| | | val resultList = mutableListOf<String>() |
| | | |
| | |
| | | override fun autoScore3(tGuid: String, sceneTypeId: String): String { |
| | | if (isAutoScoreRunning) return "自动评分执行中,请等待完成" |
| | | isAutoScoreRunning = true |
| | | val t = Constant.ScenseType.getByValue(sceneTypeId) |
| | | autoScore.sceneType = t |
| | | autoScore.topTaskGrade(tGuid) |
| | | // val t = Constant.ScenseType.getByValue(sceneTypeId) |
| | | // autoScore.sceneType = t |
| | | // autoScore.topTaskGrade(tGuid) |
| | | aopEvaluation.executeByTopTask(tGuid, sceneTypeId.toInt()) |
| | | isAutoScoreRunning = false |
| | | return "自动评分完成" |
| | | } |
| | |
| | | createCriteria().andEqualTo("iguid", inspectionId) |
| | | }) |
| | | } |
| | | |
| | | override fun autoEvaluate(areaVo: AreaVo): BgTaskStatus? { |
| | | //执行自动评估 |
| | | return aopTaskCtrl.startNewTask(areaVo) |
| | | } |
| | | |
| | | override fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? { |
| | | //1. 查找历史记录,查看评估是否已存在 |
| | | return evaluationRep.findAutoScore(areaVo) |
| | | } |
| | | } |