From b6c29718e10e25a6a49fe9538f554371e1560720 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 25 七月 2022 15:50:22 +0800
Subject: [PATCH] 1. 调试监管统计文件下载接口; 2. 新增自动评分刷新接口; 3. 针对前端页面,调整部分接口

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt |   97 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
index 8ea2a19..2a26187 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -2,6 +2,9 @@
 
 import cn.flightfeather.supervision.business.AutoScore
 import cn.flightfeather.supervision.business.AutoScore2
+import cn.flightfeather.supervision.business.storage.StAutoScore
+import cn.flightfeather.supervision.business.storage.item.StScoreItem_1
+import cn.flightfeather.supervision.business.storage.item.StScoreItem_2
 import cn.flightfeather.supervision.domain.ds1.entity.*
 import cn.flightfeather.supervision.domain.ds1.mapper.*
 import cn.flightfeather.supervision.common.utils.Constant
@@ -24,6 +27,10 @@
 
     val dateUtil = DateUtil()
 
+    @Autowired
+    lateinit var scoreItem1: StScoreItem_1
+    @Autowired
+    lateinit var scoreItem2: StScoreItem_2
     @Autowired
     lateinit var taskService: TaskService
     @Autowired
@@ -474,6 +481,8 @@
                     autoScore.subtask = subtask
                     autoScore.calculateScore()
                 }
+//                val autoScore = StAutoScore(scoreItem1, scoreItem2)
+//                autoScore.sceneType = Constant.ScenseType.TYPE1
             }
         }
 
@@ -968,37 +977,67 @@
         return resultList
     }
 
-    override fun getByTopTaskAndDate(topTaskId: String, startTime: String, endTime: String, sceneTypeId: Int?): List<SubtaskVo> {
-        val startDate = dateUtil.StringToDate(startTime)
-        val endDate = dateUtil.StringToDate(endTime)
-
-        val cal = Calendar.getInstance().apply { time = startDate }
-        val _startTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: startTime
-
-        if (endDate == null) {
-            cal.add(Calendar.MONTH, 1)
-            cal.add(Calendar.DAY_OF_MONTH, -1)
-        } else {
-            cal.time = endDate
-        }
-        cal.set(Calendar.HOUR_OF_DAY, 23)
-        cal.set(Calendar.MINUTE, 59)
-        cal.set(Calendar.SECOND, 59)
-        val _endTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: endTime
-
-//        val resultList = mutableListOf<SubtaskVo>()
-        val resultList = subtaskMapper.selectByTopTask(topTaskId, _startTime, _endTime, sceneTypeId)
-//        subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
-//            createCriteria()
-//                    .andGreaterThanOrEqualTo("planstarttime", startDate)
-//                    .andLessThanOrEqualTo("planstarttime", endDate)
-//                    .andEqualTo("tguid", topTaskId)
-//        }).forEach {
-//            val vo = SubtaskVo()
-//            BeanUtils.copyProperties(it, vo)
-//            resultList.add(vo)
+    override fun getByTopTaskAndDate(topTaskId: String, startTime: String?, endTime: String?, sceneTypeId: Int?): List<Subtask> {
+//        val startDate = dateUtil.StringToDate(startTime)
+//        val endDate = dateUtil.StringToDate(endTime)
+//
+//        val cal = Calendar.getInstance().apply { time = startDate }
+//        val _startTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: startTime
+//
+//        if (endDate == null) {
+//            cal.add(Calendar.MONTH, 1)
+//            cal.add(Calendar.DAY_OF_MONTH, -1)
+//        } else {
+//            cal.time = endDate
 //        }
+//        cal.set(Calendar.HOUR_OF_DAY, 23)
+//        cal.set(Calendar.MINUTE, 59)
+//        cal.set(Calendar.SECOND, 59)
+//        val _endTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: endTime
+
+        val resultList = subtaskMapper.selectByTopTask2(topTaskId, sceneTypeId)
 
         return resultList
     }
+
+    override fun getSummary(topTaskId: String, sceneTypeId: Int?): List<SubTaskSummary> {
+//        val result = mutableListOf<SubTaskSummary>()
+
+//        subtaskMapper.selectByTopTask2(topTaskId, sceneTypeId).forEach {
+//            val scene = scenseMapper.selectByPrimaryKey(it.scenseid)
+//            var p = 0
+//            var c = 0
+//            var pc = 0
+//            var cc = 0
+//            problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
+//                createCriteria().andEqualTo("stguid", it.stguid)
+//            }).forEach {pro ->
+//                p++
+//                if (pro.ischanged == true) c++
+//                if (pro.extension3 != Constant.PROBLEM_UNCHECKED) pc++
+//                if (pro.extension3 == Constant.CHANGE_CHECK_PASS || pro.extension3 == Constant.CHANGE_CHECK_FAIL) cc++
+//            }
+//            val ins = inspectionMapper.selectByExample(Example(Inspection::class.java).apply {
+//                createCriteria().andEqualTo("stguid", it.stguid)
+//            })
+//            result.add(SubTaskSummary().apply {
+//                stGuid = it.stguid
+//                stName = it.name
+//                if (ins.isNotEmpty()) insGuid = ins[0].guid
+//                sceneId = it.scenseid
+//                sceneName = scene.name
+//                sceneType = scene.type
+//                stPlanTime = it.planstarttime
+//                proNum = p
+//                changeNum = c
+//                proCheckedNum = pc
+//                changeCheckedNum = cc
+//            })
+//        }
+
+//        return result
+
+        return subtaskMapper.getSummary(topTaskId, sceneTypeId)
+
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3