From c55c9a51cea46caea88b2bee5cc3c9ddaa9fc468 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期三, 11 十二月 2024 08:44:22 +0800 Subject: [PATCH] 1. 新增 BaseExcel.kt 和 BaseTemplate.kt 的 toObject输出到对象方法 2. 新增 BaseTemplate 是否执行的状态属性 3. 在cn.flightfeather.supervision.business.report.bean包下新增 BaseTemplateResult.kt 结果对象抽象类 以及 ProAnalysisSummaryResult.kt 和 ProDetailSummaryResult.kt 对应实现:问题整改动态跟踪和分街镇问题整改分析的中间结果对象 注:除了问题整改动态跟踪和分街镇问题整改分析其他的汇总表对象中都没有对应中间结果对象,因此这里还有报错信息 --- src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt b/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt index bd04aa1..4de46d6 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt @@ -4,7 +4,7 @@ import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation -import cn.flightfeather.supervision.common.exception.ResponseErrorException +import cn.flightfeather.supervision.common.exception.BizException import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl import cn.flightfeather.supervision.common.executor.BgTaskStatus import cn.flightfeather.supervision.common.executor.BgTaskType @@ -12,6 +12,7 @@ import cn.flightfeather.supervision.domain.ds1.repository.TaskRep import cn.flightfeather.supervision.lightshare.vo.AreaVo import org.springframework.stereotype.Component +import java.time.LocalDateTime /** * 鑷姩璇勪及浠诲姟绠$悊 @@ -39,6 +40,29 @@ dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE3.value.toInt(), jsMpDataAnalysis) } + fun startAllEvaluation(time: LocalDateTime) { + startEvaluation(getArea(time, "310106", "闈欏畨鍖�", Constant.SceneType.TYPE1)) + startEvaluation(getArea(time, "310104", "寰愭眹鍖�", Constant.SceneType.TYPE5)) + startEvaluation(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE1)) + startEvaluation(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE2)) + startEvaluation(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE3)) + } + + fun startEvaluation(areaVo: AreaVo) { + val task = taskRep.findOneTask(areaVo) + val taskId = task?.tguid + val sceneType = areaVo.scensetypeid?.toInt() ?: throw BizException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及") + aopEvaluation.executeByTopTask(taskId, sceneType) + } + + fun startAll(time: LocalDateTime) { + startNewTask(getArea(time, "310106", "闈欏畨鍖�", Constant.SceneType.TYPE1)) + startNewTask(getArea(time, "310104", "寰愭眹鍖�", Constant.SceneType.TYPE5)) + startNewTask(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE1)) + startNewTask(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE2)) + startNewTask(getArea(time, "310116", "閲戝北鍖�", Constant.SceneType.TYPE3)) + } + fun startNewTask(areaVo: AreaVo): BgTaskStatus { val task = taskRep.findOneTask(areaVo) val taskId = task?.tguid @@ -46,18 +70,19 @@ val districtCode = areaVo.districtcode val districtName = areaVo.districtname // val d = LocalDateTime.parse(areaVo.starttime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) - val d = areaVo.starttime ?: throw ResponseErrorException("鑷姩璇勪及浠诲姟蹇呴』璁惧畾鏃堕棿") + val d = areaVo.starttime ?: throw BizException("鑷姩璇勪及浠诲姟蹇呴』璁惧畾鏃堕棿") val year = d.year val month = d.monthValue - val sceneType = areaVo.scensetypeid?.toInt() ?: throw ResponseErrorException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及") + val sceneType = areaVo.scensetypeid?.toInt() ?: throw BizException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及") val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}" val name = "${districtName}${Constant.SceneType.getDes(sceneType)}鑷姩璇勫垎" val bgTask = backgroundTaskCtrl.startNewTask(BgTaskType.AUTO_SCORE, id, name) { + // 鐩戞祴鏁版嵁鍒嗘瀽鍏ュ簱 dataAnalysis(districtCode, sceneType, taskId, year, month) - + // 鑷姩璇勪及璁$畻鍏ュ簱 aopEvaluation.executeByTopTask(taskId, sceneType) - + // 鐜俊鐮佺粨鏋滆浆鎹㈠叆搴� aopCreditCode.execute(AopDataConfig( year = year, month = month, @@ -69,7 +94,7 @@ } return bgTask.taskStatus } else { - throw ResponseErrorException("宸℃煡鎬讳换鍔′笉瀛樺湪锛屾棤娉曡瘎浼�") + throw BizException("宸℃煡鎬讳换鍔′笉瀛樺湪锛屾棤娉曡瘎浼�") } } @@ -78,4 +103,17 @@ aopDataAnalysis?.setResource(taskId, sceneType, year, month) aopDataAnalysis?.execute() } + + fun getArea(time: LocalDateTime, dCode: String, dName: String, sceneType: Constant.SceneType): AreaVo { + return AreaVo().apply { + provincecode = "31" + provincename = "涓婃捣甯�" + citycode = "3100" + cityname = "涓婃捣甯�" + starttime = time + districtcode = dCode + districtname = dName + scensetypeid = sceneType.value + } + } } \ No newline at end of file -- Gitblit v1.9.3