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/lightshare/service/impl/ProblemlistServiceImpl.kt |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
index bf7ef44..eb2d02b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -116,8 +116,8 @@
     override fun getStatisticalResult(areaVo: AreaVo): List<StatisticsVo> {
         val districtcode = areaVo.districtcode
         val sceneType = areaVo.scensetypeid
-        val startTime = areaVo.starttime
-        val endTime = areaVo.endtime
+        val startTime = areaVo.starttime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
+        val endTime = areaVo.endtime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
         val maps = problemlistMapper.getStatisticalResult(districtcode,startTime, endTime, sceneType)
         val statisticsVos = mutableListOf<StatisticsVo>()
         maps.forEach {
@@ -146,7 +146,12 @@
 //                .andGreaterThanOrEqualTo("endtime", areaVo.endtime)
 //                .andEqualTo("districtcode", areaVo.districtcode)
         val chargeInfoVo = ChargeInfoVo()
-        val sql = "select T_GUID, T_Name from tm_t_task where TS_GUID IS NULL and T_StartTime <= '" + areaVo.starttime + "' and T_EndTime >= '" + areaVo.endtime + "' and T_DistrictCode = '" + areaVo.districtcode +"'"
+        val sTime = areaVo.starttime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
+        val eTime = areaVo.endtime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
+        val sql =
+            "select T_GUID, T_Name from tm_t_task where TS_GUID IS NULL and T_StartTime <= '" + sTime + "' and T_EndTime" +
+                    " >= '" + eTime + "' and T_DistrictCode = '" + areaVo.districtcode + "'"
+
         val maps1 = taskMapper.selectSE(sql)
         var topTaskId = String()
         var topTaskName = String()
@@ -323,6 +328,12 @@
                 mediafileMapper.deleteByExample(Example(Mediafile::class.java).apply {
                     createCriteria().andEqualTo("businessguid", id)
                 })
+                //鏇存柊宸℃煡淇℃伅涓殑闂鏁伴噺
+                val inspection = inspectionMapper.selectByPrimaryKey(p.iguid)
+                if (inspection.problemcount != null && inspection.problemcount!! > 0) {
+                    inspection.problemcount = inspection.problemcount!! - 1
+                    inspectionMapper.updateByPrimaryKey(inspection)
+                }
                 BaseResponse(true, "闂鍒犻櫎鎴愬姛", data = i)
             }
         }
@@ -486,6 +497,12 @@
             }
         }
 
+        //鏇存柊宸℃煡淇℃伅鐨勯棶棰樻暟
+        if (inspection.problemcount != null) {
+            inspection.problemcount = inspection.problemcount!! + 1
+            inspectionMapper.updateByPrimaryKey(inspection)
+        }
+
         return BaseResponse(true)
     }
 
@@ -544,4 +561,22 @@
 
         return BaseResponse(true)
     }
+
+    override fun getBySubTask(stGuid: String): List<ProblemlistVo> {
+        //鏍规嵁瀛愪换鍔D鑾峰彇闂鍒楄〃
+        val problemListVo = findBySubtaskId(stGuid)
+        //鍒ゆ柇鏄惁鏈夐棶棰樺垪琛�
+        if (!problemListVo.isEmpty()) {
+            //鏍规嵁姣忎釜闂,鑾峰彇濯掍綋鏂囦欢
+            problemListVo.forEach {
+                val mediafileVo = mediafileService.findByBusinessGUID(it.guid!!)
+                //鍒ゆ柇鏄惁鏈夊獟浣撹祫鏂�
+                if (!mediafileVo.isEmpty()) {
+                    //璧嬪��
+                    it.mediafileList = mediafileVo
+                }
+            }
+        }
+        return problemListVo
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3