From f565fbc09724992d53ec6632c3e5d1de3325f328 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 11 一月 2024 17:33:44 +0800
Subject: [PATCH] 1. 调整返回接口的异常捕获类为自定义异常类; 2. 修改AreaVo类中时间参数的类型; 3. 新增文档生成任务类型,并新增文档后台生成任务逻辑;

---
 src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt b/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
similarity index 87%
rename from src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt
rename to src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
index c013604..bd04aa1 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
@@ -1,9 +1,10 @@
-package cn.flightfeather.supervision.business.autooutput
+package cn.flightfeather.supervision.business.bgtask
 
 import cn.flightfeather.supervision.business.autooutput.dataanalysis.*
 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.executor.BackgroundTaskCtrl
 import cn.flightfeather.supervision.common.executor.BgTaskStatus
 import cn.flightfeather.supervision.common.executor.BgTaskType
@@ -11,7 +12,6 @@
 import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
 import cn.flightfeather.supervision.lightshare.vo.AreaVo
 import org.springframework.stereotype.Component
-import java.time.LocalDate
 
 /**
  * 鑷姩璇勪及浠诲姟绠$悊
@@ -45,10 +45,11 @@
         if (taskId != null) {
             val districtCode = areaVo.districtcode
             val districtName = areaVo.districtname
-            val d = LocalDate.parse(areaVo.starttime)
+//            val d = LocalDateTime.parse(areaVo.starttime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
+            val d = areaVo.starttime ?: throw ResponseErrorException("鑷姩璇勪及浠诲姟蹇呴』璁惧畾鏃堕棿")
             val year = d.year
             val month = d.monthValue
-            val sceneType = areaVo.scensetypeid?.toInt() ?: throw IllegalStateException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及")
+            val sceneType = areaVo.scensetypeid?.toInt() ?: throw ResponseErrorException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及")
 
             val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}"
             val name = "${districtName}${Constant.SceneType.getDes(sceneType)}鑷姩璇勫垎"
@@ -68,7 +69,7 @@
             }
             return bgTask.taskStatus
         } else {
-            throw IllegalStateException("宸℃煡鎬讳换鍔′笉瀛樺湪锛屾棤娉曡瘎浼�")
+            throw ResponseErrorException("宸℃煡鎬讳换鍔′笉瀛樺湪锛屾棤娉曡瘎浼�")
         }
     }
 

--
Gitblit v1.9.3