pom.xml
@@ -34,24 +34,23 @@ <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-quartz</artifactId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>spring-boot-starter-logging</artifactId> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-quartz</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId> <exclusions> <exclusion> <artifactId>spring-boot-starter-logging</artifactId> <groupId>org.springframework.boot</groupId> </exclusion> </exclusions> </dependency> <dependency> @@ -123,11 +122,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- https://mvnrepository.com/artifact/com.alibaba/druid --> src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt
@@ -1,15 +1,16 @@ package cn.flightfeather.supervision import cn.flightfeather.supervision.datafetch.FetchController import cn.flightfeather.supervision.infrastructure.service.ServerManager import cn.flightfeather.supervision.business.datafetch.FetchController import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.ApplicationRunner import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.scheduling.annotation.EnableScheduling @SpringBootApplication @EnableScheduling class SupervisionApplication { @Autowired @@ -18,7 +19,7 @@ @Bean fun runner() = ApplicationRunner { fetchController. run() fetchController.run() } } src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataAnalysis.kt
@@ -106,6 +106,8 @@ drMin = tempMin.total drOverAvgPer = overAvgRate(drAvg, dAvg) drDataNum = count(dataList) // 彿°æ®é为0æ¶ï¼è¶ æåº¦åºåå¼ç¾åæ¯å为0 if (drDataNum == 0) drOverAvgPer = .0 drEffectiveRate = effectiveRate(dataList, evaluationScene) } //æ´æ°å ¥åº src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt
@@ -70,7 +70,9 @@ evaluationScene.clear() evaluationScene.index = i evaluationScene.setDefaultScene(scene) callback(i, evaluationScene) do { callback(i, evaluationScene) } while (evaluationScene.gotoNextSubTask()) } } 1 -> { @@ -92,6 +94,9 @@ sceneSourceList.clear() val taskSceneIdList = aopDbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode) taskSceneIdList.forEach { println(it.name) } sceneSourceList.addAll(taskSceneIdList) } @@ -150,12 +155,21 @@ }) } //å·¡æ¥ä»»å¡ä¿¡æ¯ var subTaskIndex = 0 val subTask = InfoProxy<Subtask> {_,_ -> return@InfoProxy if (subTaskList.value?.isNotEmpty() == true) { subTaskList.value?.get(subTaskIndex) } else { null } } val subTaskList = InfoProxy<List<Subtask>> {_,_ -> return@InfoProxy aopDbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { createCriteria().andEqualTo("scenseid", scene.value?.guid) // .andBetween("planstarttime", config?.startTime, config?.endTime) .andEqualTo("tguid", config?.topTaskGuid) })?.takeIf { it.isNotEmpty() }?.get(0) }) } //ç°åºå·¡æ¥ä¿¡æ¯ @@ -341,21 +355,43 @@ */ fun clear() { scene.clear() subTaskIndex = 0 subTaskList.clear() userInfo.clear() userInfoTZ.clear() baseScene.clear() problemTypes.clear() ledgerCount.clear() ledgerRecords.clear() clearSubtask() } fun clearSubtask() { subTask.clear() inspection.clear() baseScene.clear() problems.clear() evaluation.clear() itemevaluationList.clear() problemTypes.clear() baseRule.clear() totalScore.clear() topItems.clear() baseRule.clear() rules.clear() ledgerCount.clear() ledgerRecords.clear() } /** * 忢è³ä¸ä¸ä¸ªå·¡æ¥ä»»å¡ * ä¸ä¸ªåºæ¯å¯è½åæ¶åå¨å¤ä¸ªå·¡æ¥ä»»å¡[subTaskList]ï¼éè¦å¯¹æ¯ä¸ªå·¡æ¥ä»»å¡åå«è¿è¡è¯å * @return æ¯å¦æä¸ä¸ä¸ªå·¡æ¥ä»»å¡ */ fun gotoNextSubTask(): Boolean { return if (subTaskIndex + 1 < (subTaskList.value?.size ?: 0)) { clearSubtask() subTaskIndex++ true } else { false } } /** src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopEvaluation.kt
@@ -43,6 +43,11 @@ reScoreItem10: ReScoreItem10, reScoreItem11: ReScoreItem11, ) { //æ£å¨è¿è¡è¯ä¼°çå·¡æ¥ä»»å¡ private val runningSubtask = mutableListOf<String>() //æ£å¨è¿è¡è¯ä¼°çæ»å·¡æ¥ä»»å¡ private val runningTopTask = mutableListOf<String>() //ç¹å®è¯å项ï¼é¤äºç»ä¸çæ ¹æ®å·¡æ¥é®é¢ç´æ¥æ£åå¤ï¼æç¹å®çæ£åé»è¾çè¯ä¼°é¡¹ï¼ private val itemList = mutableListOf<ScoreItem>() @@ -73,9 +78,31 @@ /** * 对ç¹å®çå·¡æ¥ä»»å¡è¿è¡åç¬è¯å */ fun executeBySubTask(subTask:Subtask) { fun executeBySubTask(subTask: Subtask) { if (checkSubtaskExist(subTask)) return val source = setResource(subTask) execute(source) runningSubtask.remove(subTask.stguid) } @Synchronized private fun checkTopTaskExist(topTaskGuid: String?): Boolean { return if (runningTopTask.contains(topTaskGuid)) { true } else { topTaskGuid?.let { runningTopTask.add(it) } false } } @Synchronized private fun checkSubtaskExist(subTask: Subtask): Boolean { return if (subTask.stguid == null || runningSubtask.contains(subTask.stguid)) { true } else { runningSubtask.add(subTask.stguid!!) false } } private fun setResource(subTask: Subtask): AopDataSource { @@ -101,7 +128,7 @@ private fun execute(source: AopDataSource) { //è·åæ°æ®æºï¼å¾ è¯ä¼°çåºæ¯ï¼ //循ç¯å¤çæ¯ä¸ªåºæ¯ source.loop {index, evaluationScene -> source.loop { index, evaluationScene -> if (evaluationScene.noRecord()) return@loop itemGrade(index, evaluationScene) @@ -166,7 +193,10 @@ /** * è®¡ç®æ»å */ private fun totalGrade(index: Int, evaluationScene: AopDataSource.EvaluationScene): Pair<Evaluation, List<Itemevaluation>>? { private fun totalGrade( index: Int, evaluationScene: AopDataSource.EvaluationScene, ): Pair<Evaluation, List<Itemevaluation>>? { val scene = evaluationScene.scene.value ?: return null val topItems = evaluationScene.topItems.value ?: return null val rules = evaluationScene.rules.value ?: return null @@ -179,7 +209,7 @@ total += top.extension1?.toIntOrNull() ?: 0 } val evaluation = Evaluation().apply { evaluationScene.baseRule.value?.let { evaluationScene.baseRule.value?.let { guid = UUIDGenerator.generate16ShortUUID() iguid = inspection?.guid stguid = subTask?.stguid src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
@@ -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 /** * èªå¨è¯ä¼°ä»»å¡ç®¡ç @@ -37,6 +38,29 @@ dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE1.value.toInt(), jsCsDataAnalysis) dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE2.value.toInt(), jsWhDataAnalysis) 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 { @@ -78,4 +102,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 } } } src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishEvaluation.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@ package cn.flightfeather.supervision.business.bgtask import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.Subtask import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep import org.springframework.stereotype.Component import java.time.LocalDateTime import java.util.* /** * è¡¥å å®ææææ£å¨æ§è¡çå·¡æ¥ä»»å¡ï¼å¹¶ä¸å¯¹æªè¯åçä»»å¡è¿è¡èªå¨è¯å */ @Component class TaskFinishEvaluation( private val subTaskRep: SubTaskRep, private val evaluationRep: EvaluationRep, private val aopEvaluation: AopEvaluation, ) { fun handle() { val list = subTaskRep.findByTime(2024, 5) list.forEach { it ?: return@forEach evaluationRep.findBySubtask(it.stguid) ?: aopEvaluation.executeBySubTask(it) } } } src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishSubtask.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,30 @@ package cn.flightfeather.supervision.business.bgtask import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep import org.springframework.stereotype.Component import java.util.* /** * ç»ææææ£å¨æ§è¡çå·¡æ¥ä»»å¡ï¼å¹¶ä¸å¯¹æªè¯åçä»»å¡è¿è¡èªå¨è¯å */ @Component class TaskFinishSubtask( private val subTaskRep: SubTaskRep, private val evaluationRep: EvaluationRep, private val aopEvaluation: AopEvaluation, ) { fun handle() { val list = subTaskRep.findByStatus(Constant.TaskProgress.RUNINGSTATUS2) list.forEach { it ?: return@forEach evaluationRep.findBySubtask(it.stguid) ?: aopEvaluation.executeBySubTask(it) it.status = Constant.TaskProgress.RUNINGSTATUS3.text it.executionendtime = Date() subTaskRep.update(it) } } } src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishTopTask.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ package cn.flightfeather.supervision.business.bgtask import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.Task import cn.flightfeather.supervision.domain.ds1.repository.TaskRep import org.springframework.stereotype.Component import java.time.LocalDateTime import java.time.ZoneId /** * ç»ææ¬æä¹åææå·²åå»ºçæ¥ä»»å¡é½å®æççé¡¶å±ä»»å¡ * @date 2024/7/2 * @author feiyu02 */ @Component class TaskFinishTopTask(private val taskRep: TaskRep) { fun handle() { // çéæææ£å¨æ§è¡ä¸çé¡¶å±ä»»å¡ val topTasks = taskRep.findTasks(Task().apply { levelnum = 2 runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text }) // è·åä¸æåºæ¶é´ val lastMonth = LocalDateTime.now().withDayOfMonth(1).withHour(0) .withMinute(0).withSecond(0).minusSeconds(1) topTasks.forEach { tt -> if (tt == null) return@forEach val time = LocalDateTime.ofInstant(tt.starttime?.toInstant(), ZoneId.systemDefault()) // ç鿬æä¹åçé¡¶å±ä»»å¡ if (time.isBefore(lastMonth)) { // ç»è®¡å¯¹åºçæææ¥ä»»å¡æ¯å¦é½å·²ç»æï¼è¥é½ç»æï¼åç»æè¯¥é¡¶å±ä»»å¡ val dayTasks = taskRep.findDayTasks(tt.tguid) var finished = true for (dt in dayTasks) { if (dt?.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) { finished = false break } } if (finished) { tt.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text taskRep.update(tt) } } } } } src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchController.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchController.kt ÐÞ¸Ä @@ -1,4 +1,4 @@ package cn.flightfeather.supervision.datafetch package cn.flightfeather.supervision.business.datafetch import org.springframework.stereotype.Component import java.util.* src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchData.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchData.kt ÐÞ¸Ä @@ -1,4 +1,4 @@ package cn.flightfeather.supervision.datafetch package cn.flightfeather.supervision.business.datafetch import java.util.concurrent.ExecutorService import java.util.concurrent.Executors src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchNightConstruction.kt ÐÞ¸Ä @@ -1,4 +1,4 @@ package cn.flightfeather.supervision.datafetch package cn.flightfeather.supervision.business.datafetch import cn.flightfeather.supervision.common.net.NCHttpService import cn.flightfeather.supervision.domain.ds1.entity.NightConstruction @@ -11,7 +11,6 @@ import com.github.pagehelper.PageHelper import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component import org.springframework.transaction.annotation.Transactional import tk.mybatis.mapper.entity.Example import java.util.* import javax.annotation.PostConstruct src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt
@@ -53,7 +53,7 @@ } utilFile.index = 1 } utilFile.outPutToFile() utilFile.outPutToFile(distance) } /** src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
@@ -74,9 +74,10 @@ index++ } fun outPutToFile() { fun outPutToFile(distance: Double? = null) { val workbook = HSSFWorkbook() val fileName = "éå±±åºå¨è¾¹ç¹ä½-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls" val tag = if (distance == null) "" else "${distance}ç±³" val fileName = "å¨è¾¹${tag}ç¹ä½-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls" val filePath = "C:\\work\\å·¥ä½\\ç¬¬ä¸æ¹ç管\\å¨è¾¹ç¹ä½\\$fileName" val out = FileOutputStream(File(filePath)) ExcelUtil.write(heads, contents, workbook) src/main/kotlin/cn/flightfeather/supervision/config/AsyncConfig.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,28 @@ package cn.flightfeather.supervision.config import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.scheduling.annotation.EnableAsync import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor import java.util.concurrent.Executor @Configuration @EnableAsync class AsyncConfig { /* *æ¤å¤æååéåºè¯¥ä½¿ç¨@Valueä»é ç½®ä¸è¯»å */ private val corePoolSize = 10 private val maxPoolSize = 200 private val queueCapacity = 10 @Bean fun taskExecutor(): Executor { val executor = ThreadPoolTaskExecutor() executor.corePoolSize = corePoolSize executor.maxPoolSize = maxPoolSize executor.setQueueCapacity(queueCapacity) executor.initialize() return executor } } src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/SubtaskMapper.kt
@@ -3,10 +3,7 @@ import cn.flightfeather.supervision.domain.ds1.entity.Scense import cn.flightfeather.supervision.domain.ds1.entity.Subtask import cn.flightfeather.supervision.domain.util.MyMapper import cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2 import cn.flightfeather.supervision.lightshare.vo.SubTaskSummary import cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo import cn.flightfeather.supervision.lightshare.vo.SubtaskVo import cn.flightfeather.supervision.lightshare.vo.* import org.apache.ibatis.annotations.Mapper import java.time.LocalDateTime import java.util.* @@ -24,6 +21,9 @@ fun getSummary(topTaskId: String, sceneTypeId: Int?): List<SubTaskSummary> // æ ¹æ®åºåèå´çé fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary> fun getSummaryByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> fun findSubTasksByProType(topTaskId: String, sceneTypeId: String, proType: String): List<Subtask> src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt
@@ -1,5 +1,6 @@ package cn.flightfeather.supervision.domain.ds1.repository import cn.flightfeather.supervision.common.exception.BizException import cn.flightfeather.supervision.domain.ds1.entity.Evaluation import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper @@ -33,6 +34,14 @@ return if (res.isNotEmpty()) res[0] else null } fun findBySubtask(subTaskId: String?): Evaluation? { try { return evaluationMapper.selectOne(Evaluation().apply { stguid = subTaskId }) } catch (e: Exception) { throw BizException("å·¡æ¥[${subTaskId}]对åºäºå¤æ¡è¯ä¼°æ»åè®°å½ï¼è¯·æ£æ¥æ¯å¦æç³»ç»é»è¾é误") } } /** * æ¥æ¾èªå¨è¯åç»æ src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt
@@ -5,7 +5,6 @@ import cn.flightfeather.supervision.domain.ds1.entity.Scense import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper import javafx.scene.Scene import org.springframework.stereotype.Repository import tk.mybatis.mapper.entity.Example import java.util.* @@ -20,11 +19,11 @@ private val subTaskRep: SubTaskRep, ) { fun insert(scense: Scense?):Int { scense ?: return 0 if (scense.guid == null) scense.guid = UUIDGenerator.generate16ShortUUID() scense.createdate = Date() return scenseMapper.insertSelective(scense) fun insert(scene: Scense?):Int { scene ?: return 0 if (scene.guid == null) scene.guid = UUIDGenerator.generate16ShortUUID() scene.createdate = Date() return scenseMapper.insertSelective(scene) } /** @@ -53,7 +52,7 @@ } fun findBySubTask(subTaskId: String): Scense? { val subtask = subTaskRep.find(subTaskId) val subtask = subTaskRep.findOne(subTaskId) return scenseMapper.selectByPrimaryKey(subtask?.scenseid) } } src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt
@@ -1,20 +1,60 @@ package cn.flightfeather.supervision.domain.ds1.repository import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.Subtask import cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.SubTaskSummary import org.springframework.stereotype.Repository import tk.mybatis.mapper.entity.Example import java.time.LocalDateTime @Repository class SubTaskRep(private val subtaskMapper: SubtaskMapper) { fun update(subtask: Subtask): Int { return subtaskMapper.updateByPrimaryKey(subtask) } fun find(id:String): Subtask? { fun findOne(id:String): Subtask? { return subtaskMapper.selectByPrimaryKey(id) } fun findAll(subtask: Subtask): List<Subtask?> { return subtaskMapper.select(subtask) } /** * æ ¹æ®æ»ä»»å¡ãåºæ¯ç±»åãé®é¢ç±»åï¼è·ååç°è¯¥ç§ç±»é®é¢çåºæ¯ä¿¡æ¯ */ fun findSubtasks(topTaskId: String, sceneTypeId:String, proType: String): List<Subtask?> { return subtaskMapper.findSubTasksByProType(topTaskId, sceneTypeId, proType) } /** * æ¥æ¾æ£å¨æ§è¡çå·¡æ¥ä»»å¡ */ fun findByStatus(status: Constant.TaskProgress): List<Subtask?> { return subtaskMapper.selectByExample(Example(Subtask::class.java).apply { createCriteria().andEqualTo("status", status.text) }) } fun findByTime(sT: LocalDateTime, eT: LocalDateTime): List<Subtask?> { return subtaskMapper.selectByExample(Example(Subtask::class.java).apply { createCriteria().andBetween("planstarttime", sT, eT) }) } fun findByTime(year: Int, month: Int): List<Subtask?> { val sT = LocalDateTime.of(year, month, 1, 0, 0, 0) val eT = sT.plusMonths(1).minusSeconds(1) return findByTime(sT, eT) } // å·¡æ¥ä»»å¡é®é¢æ´æ¹è¯¦æ ç»è®¡ç¸å ³ fun findSummary(areaVo: AreaVo): List<SubTaskSummary> { return subtaskMapper.getSummaryByArea(areaVo) } } src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
@@ -6,6 +6,7 @@ import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper import cn.flightfeather.supervision.lightshare.vo.AreaVo import org.springframework.stereotype.Repository import tk.mybatis.mapper.entity.Example import java.time.ZoneId import java.util.* @@ -24,6 +25,11 @@ endtime = Date.from(mEnd.atZone(ZoneId.systemDefault()).toInstant()) } } fun update(task: Task): Int { return taskMapper.updateByPrimaryKeySelective(task) } /** * æ¥æ¾ä¸ä¸ªæ»ä»»å¡ */ @@ -37,6 +43,10 @@ return taskMapper.select(example) } fun findTasks(task: Task): List<Task?> { return taskMapper.select(task) } /** * è·åæ»ä»»å¡å¯¹åºççç®¡çæ¬ */ @@ -44,4 +54,15 @@ val monitorList = monitorobjectversionMapper.findMonitorListByScene(taskId, sceneTypeId) return monitorList.sortedBy { it.displayid } } /** * è·åæ¥ä»»å¡ * @param taskId é¡¶å±ä»»å¡id */ fun findDayTasks(taskId: String?): List<Task?> { return taskMapper.selectByExample(Example(Task::class.java).apply { createCriteria().andEqualTo("tsguid", taskId) orderBy("starttime").desc() }) } } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SubtaskService.kt
@@ -45,9 +45,11 @@ fun getByTopTaskAndDate(topTaskId: String, startTime: String?, endTime: String?, sceneTypeId: Int? = null): List<Subtask> fun getTaskProgressByArea(areaVo: AreaVo): List<TaskProgressVo> fun getSummary(topTaskId: String, sceneTypeId: Int? = null): List<SubTaskSummary> fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo> fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary> } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt
@@ -50,8 +50,8 @@ //æ°å¢åªä½æä»¶ override fun addMedifile(mediafileVoList: String, files: Array<MultipartFile>) { logging.info("ä¸ä¼ æä»¶æ¹æ³è°ç¨") logging.info("mediafileVoList:" + mediafileVoList) // logging.info("ä¸ä¼ æä»¶æ¹æ³è°ç¨") // logging.info("mediafileVoList:" + mediafileVoList) val mapper = ObjectMapper() //json转object src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -12,6 +12,7 @@ import cn.flightfeather.supervision.domain.ds1.mapper.* import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep import cn.flightfeather.supervision.domain.ds1.repository.SceneRep import cn.flightfeather.supervision.domain.ds2.mapper.LedgerRecordMapper import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper @@ -62,6 +63,7 @@ val taskService: TaskService, private val evaluationRep: EvaluationRep, private val evaluationRuleRep: EvaluationRuleRep, private val sceneRep: SceneRep, @Value("\${filePath}") var filePath: String, @Value("\${imgPath}") var imgPath: String, ) : SearchService { @@ -560,15 +562,22 @@ } override fun getScoreDetail(subTaskId: String): ScoreDetail { //åºæ¯ä¿¡æ¯ val scene = sceneRep.findBySubTask(subTaskId) //æ»å val evaluation = evaluationRep.findBySubtask(subTaskId) //åè§åéæ¡å¾å val subRuleScores = evaluationRep.findItemEvaluation(subTaskId) if (subRuleScores.isEmpty()) throw BizException("æ è¯ä¼°è®°å½") //è¯åæ»è§å val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("æªæ¾å°ç¸å ³èªå¨è¯ä¼°è§å") //æ»è§å对åºçè¯ååè§å val subRules = evaluationRuleRep.findSubRule(rule.guid) //æ¥è¯¢ç»æ val result = ScoreDetail() result.status = if (scene?.extension1.equals("1")) "å¨å»º" else "å®å·¥" result.updateTime = evaluation?.updatedate subRules.forEach { it.ertype ?: return@forEach result.addDetail(result.details, it, it.ertype!! - 1, subRuleScores, true) src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -7,6 +7,7 @@ import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.common.utils.DateUtil import cn.flightfeather.supervision.common.utils.UUIDGenerator import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep import cn.flightfeather.supervision.domain.ds1.repository.TaskRep import cn.flightfeather.supervision.lightshare.service.SubtaskService import cn.flightfeather.supervision.lightshare.service.TaskService @@ -27,6 +28,7 @@ private val subtaskMapper: SubtaskMapper, private val aopEvaluation: AopEvaluation, private val taskRep: TaskRep, private val subTaskRep: SubTaskRep, ) : SubtaskService { val dateUtil = DateUtil() @@ -393,7 +395,7 @@ // //æ ¹æ®æ¥æè·åæ¥ä»»å¡ // val daytaskVo = taskService.findByDate(dateUtil.getDate(subtask.planstarttime)!!) //2019.3.1 by Riku åºè¯¥ç´æ¥æ ¹æ®åä»»å¡çæ¥ä»»å¡idæ¥è¯¢æ¥ä»»å¡ //åºè¯¥ç´æ¥æ ¹æ®åä»»å¡çæ¥ä»»å¡idæ¥è¯¢æ¥ä»»å¡ val daytaskVo = taskService.findByID(subtask.tsguid!!) //夿æ¯å¦ææ¥ä»»å¡ @@ -442,28 +444,28 @@ } //夿坹åºé¡¶å±ä»»å¡çæ§è¡ç¶æ val daytaskVolist = taskService.getDayTaskByTaskID(toptaskVo.tguid!!) val iterator: Iterator<TaskVo> = daytaskVolist.iterator() if (daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS3.text && toptaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text) { var bool = false while (iterator.hasNext()) { val tmp = iterator.next() if (tmp.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) { bool = true break } } if (!bool){ toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text } } else if (daytaskVo.runingstatus != toptaskVo.runingstatus){ toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text } val toptask = Task() BeanUtils.copyProperties(toptaskVo, toptask) taskMapper.updateByPrimaryKeySelective(toptask) // val daytaskVolist = taskService.getDayTaskByTaskID(toptaskVo.tguid!!) // val iterator: Iterator<TaskVo> = daytaskVolist.iterator() // if (daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS3.text // && toptaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text) { // var bool = false // while (iterator.hasNext()) { // val tmp = iterator.next() // if (tmp.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) { // bool = true // break // } // } // if (!bool){ // toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text // } // } // else if (daytaskVo.runingstatus != toptaskVo.runingstatus){ // toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text // } // val toptask = Task() // BeanUtils.copyProperties(toptaskVo, toptask) // taskMapper.updateByPrimaryKeySelective(toptask) //å¯¹å·²ç»æçåä»»å¡è¿è¡èªå¨è¯å if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text) { @@ -946,8 +948,8 @@ return subtaskMapper.getSummary(topTaskId, sceneTypeId) } override fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo> { areaVo.scensetypeid ?: throw BizException("缺å°åºæ¯ç±»ååæ°") override fun getTaskProgressByArea(areaVo: AreaVo): List<TaskProgressVo> { // areaVo.scensetypeid ?: throw BizException("缺å°åºæ¯ç±»ååæ°") val res = mutableListOf<TaskProgressVo>() taskRep.findTasks(areaVo).forEach {t-> if (t?.tguid == null) return@forEach @@ -973,4 +975,8 @@ override fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> { return subtaskMapper.getSummaryByScene(sceneId, startTime, endTime) } override fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary> { return subTaskRep.findSummary(areaVo) } } src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AutoScoreResultVo.kt
@@ -12,6 +12,7 @@ var userId: String? = null var userName: String? = null var isEnable: Boolean = true var sceneIndex: Int? = null var sceneId: String? = null var sceneName: String? = null var pName: String? = null src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
@@ -3,17 +3,27 @@ import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation import com.fasterxml.jackson.annotation.JsonInclude import java.util.* /** * è¯åè§ååå¾å */ @JsonInclude(JsonInclude.Include.NON_NULL) class ScoreDetail { // å·¥å°ç¶æï¼å¨å»ºæå®å·¥ï¼ var status: String? = null // æ»å var totalScore: Int = 0 // å¾å var score: Int = 0 // è§èæ§ç级 var grade: String? = null // æ´æ°æ¶é´ var updateTime: Date? = null // å¾åç»å var details = mutableListOf<ScoreItem>() @@ -69,12 +79,27 @@ fun calScore() { details.forEach { totalScore += it.maxScore if (it.gradeMode == "minus_mode") { score += (it.score + it.maxScore) } else if (it.gradeMode == "add_mode") { score += it.score score += when (it.gradeMode) { "minus_mode" -> { (it.score + it.maxScore) } "add_mode" -> { it.score } else -> { (it.score + it.maxScore) } } } grade = when { score >= 95 -> "è§è" // åºæ¬è§è(90..94)åè§èï¼>=95ï¼ score >= 90 -> "åºæ¬è§è" // ä¸è§è score >= 50 -> "ä¸è§è" // 严éä¸è§è else -> "严éä¸è§è" } } } src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/SubTaskSummary.kt
@@ -1,20 +1,37 @@ package cn.flightfeather.supervision.lightshare.vo import cn.flightfeather.supervision.domain.ds1.entity.Inspection import cn.flightfeather.supervision.domain.ds1.entity.Scense import cn.flightfeather.supervision.domain.ds1.entity.Subtask import java.math.BigDecimal import java.util.* class SubTaskSummary { // å·¡æ¥ä»»å¡ var stGuid: String? = null var stName: String? = null var insGuid: String? = null var sceneId: String? = null var sceneName: String? = null var sceneType: String? = null var stPlanTime: Date? = null var stStatus:String? = null var subtask: Subtask? = null // å·¡æ¥æ§è¡è®°å½ var insGuid: String? = null var inspection: Inspection? = null // 对åºåºæ¯ä¿¡æ¯ var sceneId: String? = null var sceneName: String? = null var sceneTypeId: Byte? = null var sceneType: String? = null var sceneIndex: Int? = null var longitude: BigDecimal? = null var latitude: BigDecimal? = null var location: String? = null var scene: Scense? = null // é®é¢æ´æ¹åå ¶å¯¹åºå®¡æ ¸çè®¡æ° var proNum = 0 var changeNum = 0 var proCheckedNum: Int = 0 var changeCheckedNum: Int = 0 } src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt
@@ -4,7 +4,6 @@ import cn.flightfeather.supervision.lightshare.service.SubtaskService import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.TaskVo import com.fasterxml.jackson.annotation.JsonFormat import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import org.springframework.format.annotation.DateTimeFormat @@ -76,9 +75,9 @@ @ApiOperation("è·åæç±»åºæ¯çå·¡æ¥ä»»å¡ç»è®¡ä¿¡æ¯") @PostMapping("/summary/area") fun getSummaryByArea( fun getTaskProgressByArea( @RequestBody areaVo: AreaVo, ) = subtaskService.getSummaryByArea(areaVo) ) = resPack { subtaskService.getTaskProgressByArea(areaVo) } @ApiOperation("è·åæä¸ªåºæ¯çå·¡æ¥ä»»å¡") @GetMapping("/byScene") @@ -87,4 +86,10 @@ @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") startTime: LocalDateTime?, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") endTime: LocalDateTime?, ) = subtaskService.getByScene(sceneId, startTime, endTime) @ApiOperation("è·åæç±»åºæ¯çå·¡æ¥ä»»å¡ç»è®¡ä¿¡æ¯") @PostMapping("/summary/area/problem") fun getSummaryByArea( @RequestBody areaVo: AreaVo, ) = resPack { subtaskService.getSummaryByArea(areaVo) } } src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,59 @@ package cn.flightfeather.supervision.scheduler import cn.flightfeather.supervision.business.bgtask.AopTaskCtrl import cn.flightfeather.supervision.business.bgtask.TaskFinishSubtask import cn.flightfeather.supervision.business.bgtask.TaskFinishTopTask import cn.flightfeather.supervision.lightshare.vo.AreaVo import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.scheduling.annotation.Async import org.springframework.scheduling.annotation.Scheduled import org.springframework.stereotype.Component import java.time.LocalDateTime /** * 宿¶ä»»å¡è°åº¦ * ä¸ä¸ªcronè¡¨è¾¾å¼æè³å°6个ï¼ä¹å¯è½7ä¸ªï¼æç©ºæ ¼åéçæ¶é´å ç´ ãæé¡ºåºä¾æ¬¡ä¸ºï¼ * ç§ï¼0~59ï¼ * åéï¼0~59ï¼ * å°æ¶ï¼0~23ï¼ * 天ï¼1~31ï¼ * æï¼1~12ï¼ * ææï¼1~7 1=SUN æ SUNï¼MONï¼TUEï¼WEDï¼THUï¼FRIï¼SATï¼ */ @Component class ScheduleService( private val taskFinishSubtask: TaskFinishSubtask, private val taskFinishTopTask: TaskFinishTopTask, private val aopTaskCtrl: AopTaskCtrl, ) { val logger: Logger = LoggerFactory.getLogger(ScheduleService::class.java) @Async @Scheduled(cron = "0 0 0 * * *") fun eachDay() { logger.info("=====>>>>>æ¯æ¥ä»»å¡æ§è¡ {}", System.currentTimeMillis()) taskFinishSubtask.handle() logger.info("=====>>>>>æ¯æ¥ä»»å¡ç»æ {}", System.currentTimeMillis()) } @Async @Scheduled(cron = "0 0 0 * * MON") fun eachWeek() { logger.info("=====>>>>>æ¯å¨ä»»å¡æ§è¡ {}", System.currentTimeMillis()) // æ§è¡ä¸å¨çèªè¯ä»»å¡ aopTaskCtrl.startAllEvaluation(LocalDateTime.now()) logger.info("=====>>>>>æ¯å¨ä»»å¡ç»æ {}", System.currentTimeMillis()) } @Async @Scheduled(cron = "0 0 0 2 * *") fun eachMonth() { logger.info("=====>>>>>æ¯æä»»å¡æ§è¡ {}", System.currentTimeMillis()) // æ§è¡ä¸ä¸ªæç宿´èªè¯ä»»å¡ aopTaskCtrl.startAll(LocalDateTime.now().minusMonths(1)) // æ§è¡é¡¶å±ä»»å¡èªå¨ç»æä»»å¡ taskFinishTopTask.handle() logger.info("=====>>>>>æ¯æä»»å¡ç»æ {}", System.currentTimeMillis()) } } src/main/resources/application.yml
@@ -71,8 +71,12 @@ # mybatis é ç½® mybatis: type-aliases-package: cn.flightfeather.supervision.domain.ds1.entity, cn.flightfeather.supervision.domain.ds2.entity type-aliases-package: cn.flightfeather.supervision.domain.ds1.entity, cn.flightfeather.supervision.domain.ds2.entity, cn.flightfeather.supervision.domain.ds3.entity mapper-locations: classpath*:mapper/**/*.xml configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl # map-underscore-to-camel-case: true ## éç¨ Mapper é ç½® #mappers å¤ä¸ªæ¥å£æ¶éå·éå¼ @@ -83,7 +87,9 @@ #loggingè·¯å¾è®¾ç½® logging: config: classpath:log4j2.xml # config: classpath:log4j2.xml level: cn.flightfeather.supervision.domain: debug springfox: documentation: src/main/resources/log4j2.xml
@@ -59,24 +59,28 @@ <!--ç¶åå®ä¹loggerï¼åªæå®ä¹äºloggerå¹¶å¼å ¥çappenderï¼appenderæä¼çæ--> <Loggers> <!--è¿æ»¤æspringåmybatisçä¸äºæ ç¨çDEBUGä¿¡æ¯--> <logger name="org.springframework" level="INFO"> <logger name="org.springframework" level="ERROR"> <appender-ref ref="Console"/> </logger> <logger name="org.mybatis" level="DEBUG"> <!-- <appender-ref ref="Console"/>--> <appender-ref ref="Console"/> </logger> <logger name="org.apache.ibatis" level="DEBUG"> <!-- <appender-ref ref="Console"/>--> <appender-ref ref="Console"/> </logger> <Logger name="java.sql.PreparedStatement" level="DEBUG" > <appender-ref ref="Console"/> </Logger> <logger name="cn.flightfeather.supervision" level="INFO" includeLocation="true" additivity="false"> <appender-ref ref="Console"/> <appender-ref ref="RollingFileInfo"/> </logger> <root level="all"> <!--<appender-ref ref="Console"/>--> <!-- <appender-ref ref="RollingFileInfo"/>--> <!-- <appender-ref ref="RollingFileWarn"/>--> <appender-ref ref="Console"/> <appender-ref ref="RollingFileInfo"/> <appender-ref ref="RollingFileWarn"/> <appender-ref ref="RollingFileError"/> </root> </Loggers> src/main/resources/mapper/ds1/EvaluationMapper.xml
@@ -57,6 +57,7 @@ <result column="userId" jdbcType="VARCHAR" property="userId"/> <result column="userName" jdbcType="VARCHAR" property="userName"/> <result column="isEnable" jdbcType="BIT" property="isEnable"/> <result column="sceneIndex" property="sceneIndex" jdbcType="INTEGER" /> <result column="sceneId" jdbcType="VARCHAR" property="sceneId"/> <result column="sceneName" jdbcType="VARCHAR" property="sceneName"/> <result column="pName" jdbcType="VARCHAR" property="pName"/> @@ -73,6 +74,7 @@ c.UI_GUID AS userId, c.UI_RealName AS userName, c.UI_IsEnable AS isEnable, b.S_Index AS sceneIndex, b.S_GUID AS sceneId, b.S_Name AS sceneName, b.S_ProvinceName AS pName, src/main/resources/mapper/ds1/InspectionMapper.xml
@@ -8,34 +8,34 @@ <id column="I_GUID" property="guid" jdbcType="VARCHAR" /> <result column="ST_GUID" property="stguid" jdbcType="VARCHAR" /> <result column="S_GUID" property="sguid" jdbcType="VARCHAR" /> <result column="I_ScenseName" property="iScensename" jdbcType="VARCHAR" /> <result column="I_ScenseAddress" property="iScenseaddress" jdbcType="VARCHAR" /> <result column="I_IsTogether" property="iIstogether" jdbcType="BIT" /> <result column="I_EntourageT" property="iEntouraget" jdbcType="VARCHAR" /> <result column="I_EntourageWX" property="iEntouragewx" jdbcType="VARCHAR" /> <result column="I_Entourage" property="iEntourage" jdbcType="VARCHAR" /> <result column="I_ExecutionStartTime" property="iExecutionstarttime" jdbcType="TIMESTAMP" /> <result column="I_ExecutionEndTime" property="iExecutionendtime" jdbcType="TIMESTAMP" /> <result column="I_ProblemCount" property="iProblemcount" jdbcType="INTEGER" /> <result column="I_IsRechecked" property="iIsrechecked" jdbcType="BIT" /> <result column="I_RecheckCount" property="iRecheckcount" jdbcType="INTEGER" /> <result column="I_PromissedNum" property="iPromissednum" jdbcType="INTEGER" /> <result column="I_ChangedNum" property="iChangednum" jdbcType="INTEGER" /> <result column="I_IsChanged" property="iIschanged" jdbcType="BIT" /> <result column="I_IsRvaluated" property="iIsrvaluated" jdbcType="BIT" /> <result column="I_isPromissed" property="iIspromissed" jdbcType="BIT" /> <result column="I_PromissedTime" property="iPromissedtime" jdbcType="TIMESTAMP" /> <result column="I_PromissedUserGUID" property="iPromisseduserguid" jdbcType="VARCHAR" /> <result column="I_PromissedUserName" property="iPromissedusername" jdbcType="VARCHAR" /> <result column="I_PromissedUserRealName" property="iPromisseduserrealname" jdbcType="VARCHAR" /> <result column="I_PromissedWay" property="iPromissedway" jdbcType="VARCHAR" /> <result column="I_PromissedDeadline" property="iPromisseddeadline" jdbcType="TIMESTAMP" /> <result column="I_PromissBookPath" property="iPromissbookpath" jdbcType="VARCHAR" /> <result column="I_SignPath" property="iSignpath" jdbcType="VARCHAR" /> <result column="I_Extension1" property="iExtension1" jdbcType="VARCHAR" /> <result column="I_Extension2" property="iExtension2" jdbcType="VARCHAR" /> <result column="I_Extension3" property="iExtension3" jdbcType="VARCHAR" /> <result column="I_Remark" property="iRemark" jdbcType="VARCHAR" /> <result column="I_ScenseName" property="scensename" jdbcType="VARCHAR" /> <result column="I_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" /> <result column="I_IsTogether" property="istogether" jdbcType="BIT" /> <result column="I_EntourageT" property="entouraget" jdbcType="VARCHAR" /> <result column="I_EntourageWX" property="entouragewx" jdbcType="VARCHAR" /> <result column="I_Entourage" property="entourage" jdbcType="VARCHAR" /> <result column="I_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" /> <result column="I_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" /> <result column="I_ProblemCount" property="problemcount" jdbcType="INTEGER" /> <result column="I_IsRechecked" property="isrechecked" jdbcType="BIT" /> <result column="I_RecheckCount" property="recheckcount" jdbcType="INTEGER" /> <result column="I_PromissedNum" property="promissednum" jdbcType="INTEGER" /> <result column="I_ChangedNum" property="changednum" jdbcType="INTEGER" /> <result column="I_IsChanged" property="ischanged" jdbcType="BIT" /> <result column="I_IsRvaluated" property="isrvaluated" jdbcType="BIT" /> <result column="I_isPromissed" property="ispromissed" jdbcType="BIT" /> <result column="I_PromissedTime" property="promissedtime" jdbcType="TIMESTAMP" /> <result column="I_PromissedUserGUID" property="promisseduserguid" jdbcType="VARCHAR" /> <result column="I_PromissedUserName" property="promissedusername" jdbcType="VARCHAR" /> <result column="I_PromissedUserRealName" property="promisseduserrealname" jdbcType="VARCHAR" /> <result column="I_PromissedWay" property="promissedway" jdbcType="VARCHAR" /> <result column="I_PromissedDeadline" property="promisseddeadline" jdbcType="TIMESTAMP" /> <result column="I_PromissBookPath" property="promissbookpath" jdbcType="VARCHAR" /> <result column="I_SignPath" property="signpath" jdbcType="VARCHAR" /> <result column="I_Extension1" property="extension1" jdbcType="VARCHAR" /> <result column="I_Extension2" property="extension2" jdbcType="VARCHAR" /> <result column="I_Extension3" property="extension3" jdbcType="VARCHAR" /> <result column="I_Remark" property="remark" jdbcType="VARCHAR" /> </resultMap> <sql id="Base_Column_List" > src/main/resources/mapper/ds1/SubtaskMapper.xml
@@ -1,185 +1,247 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper" > <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Subtask" > <!-- WARNING - @mbg.generated --> <id column="ST_GUID" property="stguid" jdbcType="VARCHAR" /> <result column="T_GUID" property="tguid" jdbcType="VARCHAR" /> <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" /> <result column="ST_name" property="name" jdbcType="VARCHAR" /> <result column="ST_Priority" property="priority" jdbcType="BIT" /> <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" /> <result column="ST_Type" property="type" jdbcType="VARCHAR" /> <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" /> <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" /> <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" /> <result column="ST_CityName" property="cityname" jdbcType="VARCHAR" /> <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" /> <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" /> <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" /> <result column="ST_TownName" property="townname" jdbcType="VARCHAR" /> <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" /> <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" /> <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" /> <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" /> <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" /> <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" /> <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" /> <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" /> <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" /> <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" /> <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" /> <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" /> <result column="ST_Status" property="status" jdbcType="VARCHAR" /> <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" /> <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" /> <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" /> <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" /> <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" /> <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" /> <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" /> <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" /> <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" /> <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" /> <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" /> <result column="ST_Remark" property="remark" jdbcType="VARCHAR" /> </resultMap> <resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo"> <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" /> <result column="districtName" property="districtName" jdbcType="VARCHAR" /> <result column="townName" property="townName" jdbcType="VARCHAR" /> <result column="sceneId" property="sceneId" jdbcType="VARCHAR" /> <result column="sceneName" property="sceneName" jdbcType="VARCHAR" /> <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" /> <result column="sceneType" property="sceneType" jdbcType="VARCHAR" /> <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" /> <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" /> <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" /> <result column="status" property="status" jdbcType="VARCHAR" /> <result column="path" property="path" jdbcType="VARCHAR" /> </resultMap> <resultMap id="SubTaskSearchResultVo2" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2"> <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" /> <result column="districtName" property="districtName" jdbcType="VARCHAR" /> <result column="townName" property="townName" jdbcType="VARCHAR" /> <result column="sceneId" property="sceneId" jdbcType="VARCHAR" /> <result column="sceneName" property="sceneName" jdbcType="VARCHAR" /> <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" /> <result column="sceneType" property="sceneType" jdbcType="VARCHAR" /> <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" /> <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" /> <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" /> <result column="status" property="status" jdbcType="VARCHAR" /> <result column="path" property="path" jdbcType="VARCHAR" /> <result column="problemId" property="problemId" jdbcType="VARCHAR" /> <result column="problemName" property="problemName" jdbcType="VARCHAR" /> <result column="problemCode" property="problemCode" jdbcType="VARCHAR" /> <result column="longitude" property="longitude" jdbcType="DECIMAL" /> <result column="latitude" property="latitude" jdbcType="DECIMAL" /> <result column="location" property="location" jdbcType="VARCHAR" /> <result column="rectification" property="rectification" jdbcType="BIT" /> <result column="rectificationTime" property="rectificationTime" jdbcType="TIMESTAMP" /> <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" /> <result column="mGuid" property="mGuid" jdbcType="VARCHAR" /> <result column="mExtension1" property="mExtension1" jdbcType="VARCHAR" /> <result column="isChanged" property="isChanged" jdbcType="BIT" /> </resultMap> <resultMap id="SubtaskVoMap" type="cn.flightfeather.supervision.lightshare.vo.SubtaskVo" > <id column="ST_GUID" property="stguid" jdbcType="VARCHAR" /> <result column="T_GUID" property="tguid" jdbcType="VARCHAR" /> <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" /> <result column="ST_name" property="name" jdbcType="VARCHAR" /> <result column="ST_Priority" property="priority" jdbcType="BIT" /> <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" /> <result column="ST_Type" property="type" jdbcType="VARCHAR" /> <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" /> <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" /> <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" /> <result column="ST_CityName" property="cityname" jdbcType="VARCHAR" /> <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" /> <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" /> <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" /> <result column="ST_TownName" property="townname" jdbcType="VARCHAR" /> <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" /> <result column="S_TypeID" property="scenseTypeId" jdbcType="VARCHAR" /> <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" /> <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" /> <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" /> <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" /> <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" /> <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" /> <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" /> <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" /> <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" /> <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" /> <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" /> <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" /> <result column="ST_Status" property="status" jdbcType="VARCHAR" /> <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" /> <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" /> <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" /> <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" /> <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" /> <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" /> <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" /> <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" /> <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" /> <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" /> <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" /> <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" /> <result column="ST_Remark" property="remark" jdbcType="VARCHAR" /> <mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper"> <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Subtask"> <!-- WARNING - @mbg.generated --> <id column="ST_GUID" property="stguid" jdbcType="VARCHAR"/> <result column="T_GUID" property="tguid" jdbcType="VARCHAR"/> <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR"/> <result column="ST_name" property="name" jdbcType="VARCHAR"/> <result column="ST_Priority" property="priority" jdbcType="BIT"/> <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT"/> <result column="ST_Type" property="type" jdbcType="VARCHAR"/> <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR"/> <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR"/> <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR"/> <result column="ST_CityName" property="cityname" jdbcType="VARCHAR"/> <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR"/> <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR"/> <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR"/> <result column="ST_TownName" property="townname" jdbcType="VARCHAR"/> <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR"/> <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR"/> <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR"/> <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR"/> <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP"/> <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP"/> <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR"/> <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR"/> <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR"/> <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR"/> <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR"/> <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR"/> <result column="ST_Status" property="status" jdbcType="VARCHAR"/> <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER"/> <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR"/> <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR"/> <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR"/> <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR"/> <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP"/> <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP"/> <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR"/> <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR"/> <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR"/> <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR"/> <result column="ST_Remark" property="remark" jdbcType="VARCHAR"/> </resultMap> <resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary" > <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" /> <result column="ST_name" property="stName" jdbcType="VARCHAR" /> <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP" /> <result column="ST_Status" property="stStatus" jdbcType="VARCHAR" /> <result column="S_GUID" property="sceneId" jdbcType="VARCHAR" /> <result column="S_Name" property="sceneName" jdbcType="VARCHAR" /> <result column="S_Type" property="sceneType" jdbcType="VARCHAR" /> <result column="I_GUID" property="insGuid" jdbcType="VARCHAR" /> <result column="proNum" property="proNum" jdbcType="INTEGER" /> <result column="changeNum" property="changeNum" jdbcType="INTEGER" /> <result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER" /> <result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER" /> </resultMap> <sql id="Base_Column_List" > <!-- WARNING - @mbg.generated --> ST_GUID, T_GUID, TS_GUID, ST_name, ST_Priority, ST_TypeNo, ST_Type, ST_ProvinceCode, ST_ProvinceName, ST_CityCode, ST_CityName, ST_DistrictCode, ST_DistrictName, ST_TownCode, ST_TownName, ST_ScenseName, ST_ScenseID, ST_ScenseAddress, ST_DeadLineType, ST_PlanStartTime, ST_PlanEndTime, ST_DeployerGUID, ST_DeployerUserName, ST_DeployerRealName, ST_DeployTime, ST_ExecutionStartTime, ST_ExecutionEndTime, ST_ExecutorGUIDs, ST_ExecutorUserNames, ST_ExecutorRealTimes, ST_Status, ST_NotifedCount, ST_RuleList, ST_AssessorGUID, ST_AssessorUserName, ST_AssessorRealName, ST_AssessTime, ST_AssessResult, ST_ThirdAssessorGUID, ST_ThirdAssessorUserName, ST_ThirdAssessorRealName, ST_ThirdAssessTime, ST_ThirdAssessResult, ST_Extension1, ST_Extension2, ST_Extension3, ST_Remark </sql> <sql id="Base_Column_List"> <!-- WARNING - @mbg.generated --> ST_GUID, T_GUID, TS_GUID, ST_name, ST_Priority, ST_TypeNo, ST_Type, ST_ProvinceCode, ST_ProvinceName, ST_CityCode, ST_CityName, ST_DistrictCode, ST_DistrictName, ST_TownCode, ST_TownName, ST_ScenseName, ST_ScenseID, ST_ScenseAddress, ST_DeadLineType, ST_PlanStartTime, ST_PlanEndTime, ST_DeployerGUID, ST_DeployerUserName, ST_DeployerRealName, ST_DeployTime, ST_ExecutionStartTime, ST_ExecutionEndTime, ST_ExecutorGUIDs, ST_ExecutorUserNames, ST_ExecutorRealTimes, ST_Status, ST_NotifedCount, ST_RuleList, ST_AssessorGUID, ST_AssessorUserName, ST_AssessorRealName, ST_AssessTime, ST_AssessResult, ST_ThirdAssessorGUID, ST_ThirdAssessorUserName, ST_ThirdAssessorRealName, ST_ThirdAssessTime, ST_ThirdAssessResult, ST_Extension1, ST_Extension2, ST_Extension3, ST_Remark </sql> <select id="getSubtask" resultMap="SubtaskSearchResultVo"> SELECT <resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo"> <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR"/> <result column="districtName" property="districtName" jdbcType="VARCHAR"/> <result column="townName" property="townName" jdbcType="VARCHAR"/> <result column="sceneId" property="sceneId" jdbcType="VARCHAR"/> <result column="sceneName" property="sceneName" jdbcType="VARCHAR"/> <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT"/> <result column="sceneType" property="sceneType" jdbcType="VARCHAR"/> <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR"/> <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP"/> <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP"/> <result column="status" property="status" jdbcType="VARCHAR"/> <result column="path" property="path" jdbcType="VARCHAR"/> </resultMap> <resultMap id="SubTaskSearchResultVo2" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2"> <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR"/> <result column="districtName" property="districtName" jdbcType="VARCHAR"/> <result column="townName" property="townName" jdbcType="VARCHAR"/> <result column="sceneId" property="sceneId" jdbcType="VARCHAR"/> <result column="sceneName" property="sceneName" jdbcType="VARCHAR"/> <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT"/> <result column="sceneType" property="sceneType" jdbcType="VARCHAR"/> <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR"/> <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP"/> <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP"/> <result column="status" property="status" jdbcType="VARCHAR"/> <result column="path" property="path" jdbcType="VARCHAR"/> <result column="problemId" property="problemId" jdbcType="VARCHAR"/> <result column="problemName" property="problemName" jdbcType="VARCHAR"/> <result column="problemCode" property="problemCode" jdbcType="VARCHAR"/> <result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="location" property="location" jdbcType="VARCHAR"/> <result column="rectification" property="rectification" jdbcType="BIT"/> <result column="rectificationTime" property="rectificationTime" jdbcType="TIMESTAMP"/> <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP"/> <result column="mGuid" property="mGuid" jdbcType="VARCHAR"/> <result column="mExtension1" property="mExtension1" jdbcType="VARCHAR"/> <result column="isChanged" property="isChanged" jdbcType="BIT"/> </resultMap> <resultMap id="SubtaskVoMap" type="cn.flightfeather.supervision.lightshare.vo.SubtaskVo"> <id column="ST_GUID" property="stguid" jdbcType="VARCHAR"/> <result column="T_GUID" property="tguid" jdbcType="VARCHAR"/> <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR"/> <result column="ST_name" property="name" jdbcType="VARCHAR"/> <result column="ST_Priority" property="priority" jdbcType="BIT"/> <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT"/> <result column="ST_Type" property="type" jdbcType="VARCHAR"/> <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR"/> <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR"/> <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR"/> <result column="ST_CityName" property="cityname" jdbcType="VARCHAR"/> <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR"/> <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR"/> <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR"/> <result column="ST_TownName" property="townname" jdbcType="VARCHAR"/> <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR"/> <result column="S_TypeID" property="scenseTypeId" jdbcType="VARCHAR"/> <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR"/> <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR"/> <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR"/> <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP"/> <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP"/> <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR"/> <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR"/> <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR"/> <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP"/> <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR"/> <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR"/> <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR"/> <result column="ST_Status" property="status" jdbcType="VARCHAR"/> <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER"/> <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR"/> <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR"/> <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR"/> <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR"/> <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP"/> <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR"/> <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP"/> <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR"/> <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR"/> <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR"/> <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR"/> <result column="ST_Remark" property="remark" jdbcType="VARCHAR"/> </resultMap> <resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary"> <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR"/> <result column="ST_name" property="stName" jdbcType="VARCHAR"/> <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP"/> <result column="ST_Status" property="stStatus" jdbcType="VARCHAR"/> <result column="S_GUID" property="sceneId" jdbcType="VARCHAR"/> <result column="S_Name" property="sceneName" jdbcType="VARCHAR"/> <result column="S_TypeID" property="sceneTypeId" jdbcType="TINYINT"/> <result column="S_Type" property="sceneType" jdbcType="VARCHAR"/> <result column="S_Location" property="location" jdbcType="VARCHAR"/> <result column="S_Longitude" property="longitude" jdbcType="DECIMAL"/> <result column="S_Latitude" property="latitude" jdbcType="DECIMAL"/> <result column="S_Index" property="sceneIndex" jdbcType="INTEGER"/> <result column="I_GUID" property="insGuid" jdbcType="VARCHAR"/> <result column="proNum" property="proNum" jdbcType="INTEGER"/> <result column="changeNum" property="changeNum" jdbcType="INTEGER"/> <result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER"/> <result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER"/> <association property="subtask" resultMap="BaseResultMap"/> <association property="inspection" resultMap="cn.flightfeather.supervision.domain.ds1.mapper.InspectionMapper.BaseResultMap"/> <association property="scene" resultMap="cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper.BaseResultMap"/> </resultMap> <sql id="Sub_Task_Summary_Column_List"> SELECT a.*, b.*, c.*, SUM(d.PL_GUID is NOT null) AS proNum, SUM(d.PL_IsChanged = TRUE) AS changeNum, SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum, SUM( d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail' ) AS changeCheckedNum FROM tm_t_subtask AS a LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID </sql> <!-- è¡æ¿åºåæ¡ä»¶ --> <sql id="Where_Area"> <if test="provincecode != null"> AND ${tableAlias}.ST_ProvinceCode = #{provincecode} </if> <if test="provincename != null"> AND ${tableAlias}.ST_ProvinceName = #{provincename} </if> <if test="citycode != null"> AND ${tableAlias}.ST_CityCode = #{citycode} </if> <if test="cityname != null"> AND ${tableAlias}.ST_CityName = #{cityname} </if> <if test="districtcode != null"> AND ${tableAlias}.ST_DistrictCode = #{districtcode} </if> <if test="districtname != null"> AND ${tableAlias}.ST_DistrictName = #{districtname} </if> <if test="towncode != null"> AND ${tableAlias}.ST_TownCode = #{towncode} </if> <if test="townname != null"> AND ${tableAlias}.ST_TownName = #{townname} </if> </sql> <!-- ä»»å¡è®¡åæ¶é´æ¡ä»¶ --> <sql id="Where_Plan_Time"> <if test="starttime != null"> AND ${tableAlias}.ST_PlanStartTime >= #{starttime} </if> <if test="endtime != null"> AND ${tableAlias}.ST_PlanStartTime <= #{endtime} </if> </sql> <select id="getSubtask" resultMap="SubtaskSearchResultVo"> SELECT a.ST_GUID as 'subTaskId', a.ST_DistrictName as 'districtName', b.S_TownName as 'townName', @@ -192,19 +254,19 @@ a.ST_PlanEndTime as 'planEndTime', a.ST_Status as 'status', c.I_Extension1 as 'path' FROM FROM tm_t_subtask AS a LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID LEFT JOIN ea_t_evaluation AS d ON a.ST_GUID = d.ST_GUID WHERE WHERE a.ST_DistrictCode = #{param1} AND a.ST_PlanStartTime >= #{param2} AND a.ST_PlanEndTime <= #{param3} <if test="param4 != null"> AND b.S_TypeID = #{param4} </if> </select> AND a.ST_PlanEndTime <= #{param3} <if test="param4 != null"> AND b.S_TypeID = #{param4} </if> </select> <select id="getSubtask2" resultMap="SubTaskSearchResultVo2"> SELECT a.ST_GUID as 'subTaskId', @@ -228,8 +290,8 @@ d.PL_IsChanged as 'rectification', d.PL_ChangedTime as 'rectificationTime', (CASE WHEN d.PL_IsChanged IS FALSE THEN d.PL_Time WHEN d.PL_ChangedTime IS NULL THEN d.PL_Time ELSE d.PL_ChangedTime END ) as 'updateTime', WHEN d.PL_ChangedTime IS NULL THEN d.PL_Time ELSE d.PL_ChangedTime END ) as 'updateTime', e.MF_GUID as 'mGuid', e.MF_Extension1 as 'mExtension1', e.MF_IsChanged as 'isChanged' @@ -258,7 +320,6 @@ AND d.PL_Extension3 IS NOT NULL ORDER BY updateTime </select> <select id="selectByTopTask" resultMap="SubtaskVoMap"><![CDATA[ select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID where a.ST_PlanStartTime >=#{param2} and a.ST_PlanEndTime <= #{param3} and a.T_GUID = #{param1}]]> @@ -266,7 +327,6 @@ and b.S_TypeID = #{param4} </if> </select> <select id="selectByTopTask2" resultMap="BaseResultMap"> select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID where a.T_GUID = #{param1} @@ -274,7 +334,6 @@ and b.S_TypeID = #{param2} </if> </select> <select id="getSummary" resultMap="SubTaskSummary"> SELECT a.ST_GUID, @@ -283,7 +342,12 @@ a.ST_Status, b.S_GUID, b.S_Name, b.S_TypeID, b.S_Type, b.S_Location, b.S_Longitude, b.S_Latitude, b.S_Index, c.I_GUID, SUM(d.PL_GUID is NOT null) AS proNum, SUM(d.PL_IsChanged = TRUE) AS changeNum, @@ -305,7 +369,6 @@ GROUP BY a.ST_GUID </select> <select id="getSummaryByScene" resultMap="SubTaskSummary"> SELECT a.ST_GUID, @@ -337,7 +400,20 @@ a.ST_GUID ORDER BY a.ST_PlanStartTime DESC </select> <select id="getSummaryByArea" resultMap="SubTaskSummary"> <include refid="Sub_Task_Summary_Column_List"/> <where> <include refid="Where_Area"> <property name="tableAlias" value="a"/> </include> <include refid="Where_Plan_Time"> <property name="tableAlias" value="a"/> </include> </where> GROUP BY a.ST_GUID ORDER BY a.ST_PlanStartTime DESC </select> <select id="findSubTasksByProType" resultMap="BaseResultMap"> SELECT a.* src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
@@ -9,6 +9,7 @@ import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep import cn.flightfeather.supervision.lightshare.service.SearchService import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import org.junit.Test @@ -48,18 +49,21 @@ @Autowired lateinit var jsWhDataAnalysis: JSWhDataAnalysis @Autowired lateinit var subTaskRep: SubTaskRep /** * éå®å·¥å°èªè¯ */ @Test fun test1() { val taskId = "tTbZIUg7nQJ1MRgE" val taskId = "P7hsgDedyN9XLrbt" val districtCode = "310106" val year = 2023 val month = 12 val year = 2024 val month = 6 val sceneType = Constant.SceneType.TYPE1.value.toInt() jaCsDataAnalysis.setResource(taskId, sceneType, year, month) jaCsDataAnalysis.execute(0.124) jaCsDataAnalysis.execute() aopEvaluation.executeByTopTask(taskId, sceneType) @@ -78,19 +82,19 @@ val taskId = "88wgq9l5gm9cUMg1" val districtCode = "310104" val districtName = "徿±åº" val year = 2023 val month = 11 val year = 2024 val month = 5 val sceneType = Constant.SceneType.TYPE5.value.toInt() xhFuDataAnalysis.setResource(taskId, sceneType, year, month) xhFuDataAnalysis.execute() aopEvaluation.executeByTopTask(taskId, sceneType) val mode = 9 searchService.writeToFile(ExcelConfigVo( taskId, districtCode = districtCode, sceneType = sceneType), mode) // xhFuDataAnalysis.setResource(taskId, sceneType, year, month) // xhFuDataAnalysis.execute() // // aopEvaluation.executeByTopTask(taskId, sceneType) // // val mode = 9 // searchService.writeToFile(ExcelConfigVo( // taskId, // districtCode = districtCode, // sceneType = sceneType), mode) aopCreditCode.execute(AopDataConfig( year = year, month = month, @@ -137,4 +141,10 @@ districtCode = districtCode, sceneType = sceneType), mode) } @Test fun aopSubtask() { val s = subTaskRep.findOne("yMRHdPg7e4i8M6aB") aopEvaluation.executeBySubTask(s!!) } } src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,53 @@ package cn.flightfeather.supervision.business.bgtask import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.repository.TaskRep import org.junit.Test import org.junit.jupiter.api.extension.ExtendWith import org.junit.runner.RunWith import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.junit.jupiter.SpringExtension import org.springframework.test.context.junit4.SpringRunner import java.io.BufferedReader import java.io.InputStreamReader import java.time.LocalDate @RunWith(SpringRunner::class) @ExtendWith(SpringExtension::class) @SpringBootTest class AopTaskCtrlTest { @Autowired lateinit var aopTaskCtrl: AopTaskCtrl @Autowired lateinit var taskRep: TaskRep @Test fun startEvaluation() { val time = LocalDate.of(2024, 6, 23).atStartOfDay() aopTaskCtrl.startEvaluation(aopTaskCtrl.getArea(time, "310106", "éå®åº", Constant.SceneType.TYPE1)) } @Test fun startNewTask(){ val time = LocalDate.of(2024, 6, 23).atStartOfDay() aopTaskCtrl.startNewTask(aopTaskCtrl.getArea(time, "310106", "éå®åº", Constant.SceneType.TYPE1)) val reader = BufferedReader(InputStreamReader(System.`in`)) reader.readLine() } @Test fun foo1() { val time = LocalDate.of(2024, 6, 23).atStartOfDay() val t1 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310106", "éå®åº", Constant.SceneType.TYPE1)) val t2 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310104", "徿±åº", Constant.SceneType.TYPE5)) val t3 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "éå±±åº", Constant.SceneType.TYPE1)) val t4 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "éå±±åº", Constant.SceneType.TYPE2)) val t5 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "éå±±åº", Constant.SceneType.TYPE3)) println(t5) } } src/test/kotlin/cn/flightfeather/supervision/business/bgtask/JinAnScoreTaskCtrlTest.kt
@@ -18,8 +18,8 @@ @Test fun startTask() { var time = LocalDateTime.of(2024, 2, 1, 0, 0, 0) repeat(3) { var time = LocalDateTime.of(2024, 5, 1, 0, 0, 0) repeat(1) { jinAnScoreTaskCtrl.startTaskJinAn(time) time = time.plusMonths(1) } src/test/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstructionTest.kt
ÎļþÃû´Ó src/test/kotlin/cn/flightfeather/supervision/datafetch/FetchNightConstructionTest.kt ÐÞ¸Ä @@ -1,8 +1,7 @@ package cn.flightfeather.supervision.datafetch package cn.flightfeather.supervision.business.datafetch import cn.flightfeather.supervision.SupervisionApplication import org.junit.Test import org.junit.jupiter.api.Assertions.* import org.junit.runner.RunWith import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt
@@ -45,8 +45,13 @@ // LocationRoadNearby.BasePlace("åéè·¯-æ±åå ¬è·¯-æ±å¹³å ¬è·¯", Pair(121.136318,30.833325), Pair(121.148624,30.836094)), // LocationRoadNearby.BasePlace("æ³æ¹¾æ¯è·¯-åéè·¯-æ±å¹³å ¬è·¯", Pair(121.155048,30.835229), Pair(121.148659,30.829861)), LocationRoadNearby.BasePlace("徿±ä¸å¸å¤§", Pair(121.416643,31.163531), Pair(121.416643,31.163531)), LocationRoadNearby.BasePlace("徿±ä¸å¸å¤§", Pair(121.419384,31.161433), Pair(121.419384,31.161433)), LocationRoadNearby.BasePlace("éå®çæµç«å½æ§ç¹", Pair(121.429439, 31.223632), Pair(121.429439, 31.223632)), LocationRoadNearby.BasePlace("é山大é2000å·", Pair(121.3404, 30.744262), Pair(121.3404, 30.744262)), LocationRoadNearby.BasePlace("ä»éç«", Pair(121.394775, 31.203982), Pair(121.419384,31.161433)), ) locationRoadNearby.searchList(bList, 2000.0) listOf(500.0, 1000.0, 2000.0, 3000.0).forEach { locationRoadNearby.searchList(bList, it) } } } src/test/kotlin/cn/flightfeather/supervision/business/subtask/TaskTest.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ package cn.flightfeather.supervision.business.subtask import cn.flightfeather.supervision.business.bgtask.TaskFinishEvaluation import cn.flightfeather.supervision.business.bgtask.TaskFinishSubtask import org.junit.Test import org.junit.jupiter.api.extension.ExtendWith import org.junit.runner.RunWith import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.junit.jupiter.SpringExtension import org.springframework.test.context.junit4.SpringRunner @RunWith(SpringRunner::class) @ExtendWith(SpringExtension::class) @SpringBootTest class TaskTest { @Autowired lateinit var taskFinishSubtask: TaskFinishSubtask @Autowired lateinit var taskFinishEvaluation: TaskFinishEvaluation @Test fun handle() { taskFinishSubtask.handle() } @Test fun handle2() { taskFinishEvaluation.handle() } } src/test/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRepTest.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,35 @@ package cn.flightfeather.supervision.domain.ds1.repository import cn.flightfeather.supervision.lightshare.vo.AreaVo import org.junit.Test import org.junit.jupiter.api.extension.ExtendWith import org.junit.runner.RunWith import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.junit.jupiter.SpringExtension import org.springframework.test.context.junit4.SpringRunner import java.time.LocalDateTime @RunWith(SpringRunner::class) @ExtendWith(SpringExtension::class) @SpringBootTest class SubTaskRepTest { @Autowired lateinit var subTaskRep: SubTaskRep @Test fun findSummary() { val res = subTaskRep.findSummary(AreaVo().apply { provincecode = "31" provincename = "䏿µ·å¸" citycode = "3100" cityname = "䏿µ·å¸" districtcode = "310116" districtname = "éå±±åº" starttime = LocalDateTime.of(2024, 7, 5, 0, 0, 0, 0) endtime = LocalDateTime.of(2024, 7, 6, 0, 0, 0, 0) }) println(res) } }