| | |
| | | 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.domain.ds1.repository.TaskRep |
| | | 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.AutoScoreResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluateResVo |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | class EvaluationServiceImpl( |
| | | private val evaluationMapper: EvaluationMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val taskRep: TaskRep, |
| | | private val aopTaskCtrl: AopTaskCtrl, |
| | | ) : EvaluationService { |
| | | |
| | |
| | | private var isAutoScoreRunning = false |
| | | |
| | | //获取某顶层任务下某个场景的街道评分排名 |
| | | override fun getRankOfTown(tguid: String, scensetypeid: String?): List<AreaVo> { |
| | | override fun getRankOfTown(tguid: String, scensetypeid: String?): List<EvaluateResVo> { |
| | | val evaluationlist = getRankInfo(tguid, scensetypeid, null) |
| | | var areaVolist = mutableListOf<AreaVo>() |
| | | var areaVolist = mutableListOf<EvaluateResVo>() |
| | | //考核类型是规范考核 |
| | | if (evaluationlist.isNotEmpty() && |
| | | Objects.equals(evaluationlist.get(0).ertype, Constant.RuleType.STANDARD.value)) { |
| | |
| | | val iterator: MutableIterator<Evaluation> = tmplist.iterator() |
| | | |
| | | val evaluation = evaluationlist.get(0)//获取一种街镇 |
| | | var areaVo = AreaVo() |
| | | var areaVo = EvaluateResVo() |
| | | areaVo = transform(areaVo, evaluation) |
| | | while (iterator.hasNext()){ |
| | | val tmp = iterator.next() |
| | |
| | | val iterator: MutableIterator<Evaluation> = tmplist.iterator() |
| | | |
| | | val evaluation = evaluationlist.get(0)//获取一种街镇 |
| | | var areaVo = AreaVo() |
| | | var areaVo = EvaluateResVo() |
| | | areaVo = transform(areaVo, evaluation) |
| | | while (iterator.hasNext()){ |
| | | val tmp = iterator.next() |
| | |
| | | } |
| | | |
| | | //Evaluation传递数据给AreaVo |
| | | fun transform(areaVo: AreaVo, evaluation: Evaluation):AreaVo{ |
| | | fun transform(areaVo: EvaluateResVo, evaluation: Evaluation):EvaluateResVo{ |
| | | areaVo.provincecode = evaluation.provincecode |
| | | areaVo.provincename = evaluation.provincename |
| | | areaVo.citycode = evaluation.citycode |
| | |
| | | } |
| | | |
| | | //按街道严重不规范场景百分比排序 |
| | | fun sort(areaVolist: MutableList<AreaVo>):MutableList<AreaVo>{ |
| | | Collections.sort(areaVolist, object : Comparator<AreaVo>{ |
| | | override fun compare(o1: AreaVo?, o2: AreaVo?): Int { |
| | | fun sort(areaVolist: MutableList<EvaluateResVo>):MutableList<EvaluateResVo>{ |
| | | Collections.sort(areaVolist, object : Comparator<EvaluateResVo>{ |
| | | override fun compare(o1: EvaluateResVo?, o2: EvaluateResVo?): Int { |
| | | var num1 = 0.0 |
| | | if (o1!!.allsensenum != 0) |
| | | num1 = (o1.notstandardnum/o1.allsensenum).toDouble() |
| | |
| | | |
| | | override fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? { |
| | | //1. 查找历史记录,查看评估是否已存在 |
| | | areaVo.scensetypeid ?: throw IllegalStateException("查询时必须选择一个场景类型") |
| | | val task = taskRep.findOneTask(areaVo) ?: throw IllegalStateException("查询时必须选择一个场景类型") |
| | | return evaluationRep.findAutoScore(areaVo) |
| | | } |
| | | } |