| | |
| | | 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.repository.DataProductRep |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.stereotype.Component |
| | |
| | | class ReportTaskCtrl( |
| | | private val backgroundTaskCtrl: BackgroundTaskCtrl, |
| | | private val dbMapper: DbMapper, |
| | | private val mapper: DataProductRep, |
| | | @Value("\${filePath}") private val filePath: String, |
| | | ) { |
| | | |
| | |
| | | val bgTask = backgroundTaskCtrl.startNewTask(BgTaskType.DOCUMENT, id, taskName) { |
| | | val p = "$filePath/autoscore/" |
| | | baseExcel.toFile(p) |
| | | baseExcel.templates.forEach { |
| | | it.toDBEntity() |
| | | it.toDBBaseInfoEntity() |
| | | mapper.insertDataProduct(it.dataProduct, it.entities) |
| | | } |
| | | true |
| | | } |
| | | bgTask.taskStatus.extra = downloadUrl |