src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
@@ -24,9 +24,11 @@
import cn.flightfeather.supervision.lightshare.service.SearchService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.*
import com.github.pagehelper.PageHelper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import tk.mybatis.mapper.entity.Example
import java.io.File
import java.util.*
@@ -39,7 +41,6 @@
    private val evaluationRep: EvaluationRep,
    private val taskRep: TaskRep,
    private val aopTaskCtrl: AopTaskCtrl,
    private val searchService: SearchService,
    private val dbMapper: DbMapper,
    @Value("\${filePath}") private val filePath: String,
    private val reportTaskCtrl: ReportTaskCtrl,
@@ -275,6 +276,12 @@
        })
    }
    override fun findBySceneId(sceneId: String, page: Int, pageSize: Int): Pair<DataHead, List<Evaluation>> {
        val p = PageHelper.startPage<Evaluation>(page, pageSize)
        val evaluationList = evaluationMapper.select(Evaluation().apply { this.sguid = sceneId })
        return DataHead(p) to evaluationList
    }
    override fun autoEvaluate(areaVo: AreaVo): BgTaskStatus? {
        //执行自动评估
        return aopTaskCtrl.startNewTask(areaVo)
@@ -284,7 +291,13 @@
        //1. 查找历史记录,查看评估是否已存在
//        areaVo.scensetypeid ?: throw ResponseErrorException("查询时必须选择一个场景类型")
//        val task = taskRep.findOneTask(areaVo) ?: throw ResponseErrorException("查询时必须选择一个场景类型")
        return evaluationRep.findAutoScore(areaVo)
        val evaList = evaluationRep.findAutoScore(areaVo)
        evaList?.forEach {
            it?.subTaskId?.let { id->
                it.itemEvaluations = evaluationRep.findItemEvaluation(id)
            }
        }
        return evaList
    }
    override fun downloadAutoEvaluation(areaVo: AreaVo, forceUpdate: Boolean, response: HttpServletResponse): Boolean {
@@ -326,4 +339,12 @@
            return true
        }
    }
    override fun downloadAutoEvaTemplate(areaVo: AreaVo, response: HttpServletResponse) {
        TODO("Not yet implemented")
    }
    override fun uploadAutoEvaluation(areaVo: AreaVo, file: MultipartFile): Boolean {
        TODO("Not yet implemented")
    }
}