feiyu02
9 天以前 85ef942e7195abeb71466b7159c3ee30161e1e54
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt
@@ -7,13 +7,16 @@
import cn.flightfeather.supervision.business.report.file.ReportThree
import cn.flightfeather.supervision.business.report.file.ReportTwo
import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.domain.ds1.mapper.DataProductMapper
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.DataProductService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import cn.flightfeather.supervision.model.dataproduct.DataProdOption
import cn.flightfeather.supervision.model.dataproduct.PPListProbRecurrence
import cn.flightfeather.supervision.model.dataproduct.PPListProblemChange
import org.springframework.beans.BeanUtils
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpHeaders
import org.springframework.http.MediaType
@@ -33,6 +36,7 @@
    private val dbMapper: DbMapper,
    @Value("\${filePath}") private val filePath: String,
    private val reportTaskCtrl: ReportTaskCtrl,
    private val dataProductMapper: DataProductMapper,
) : DataProductService {
    override fun downloadProduct(
@@ -83,10 +87,39 @@
    }
    override fun problemChangeList(option: DataProdOption): List<PPListProblemChange> {
        TODO("Not yet implemented")
        return dataProductMapper.problemChangeList(option)
    }
    override fun problemRecurrence(option: DataProdOption): List<PPListProbRecurrence> {
        val res = mutableListOf<PPListProbRecurrence>()
        problemChangeList(option).forEach {pcl ->
            val r = res.find {
                it.sceneName == pcl.sceneName && it.problemName == pcl.problemName
            }
            if (r == null) {
                val probRec = PPListProbRecurrence()
                BeanUtils.copyProperties(pcl, probRec)
                probRec.apply {
                    proNum = 1
                    changeNum += pcl.changeSum
                }
                res.add(probRec)
            } else {
                r.apply {
                    proNum++
                    changeNum += pcl.changeSum
                }
            }
        }
        return res
    }
    override fun findProduct(queryOpt: QueryOpt, page: Int, perPage: Int) {
        // 根据产品类型编号、区域、时段、场景类型、配置id查询
        TODO("Not yet implemented")
    }
    override fun generateProduct(queryOpt: QueryOpt) {
        TODO("Not yet implemented")
    }
}