已修改29个文件
已添加8个文件
已重命名4个文件
| | |
| | | <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-data-mongodb-reactive</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | <artifactId>spring-boot-starter-quartz</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <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 --> |
| | |
| | | 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 |
| | |
| | | drMin = tempMin.total |
| | | drOverAvgPer = overAvgRate(drAvg, dAvg) |
| | | drDataNum = count(dataList) |
| | | // 彿°æ®é为0æ¶ï¼è¶
æåº¦åºåå¼ç¾åæ¯å为0 |
| | | if (drDataNum == 0) drOverAvgPer = .0 |
| | | drEffectiveRate = effectiveRate(dataList, evaluationScene) |
| | | } |
| | | //æ´æ°å
¥åº |
| | |
| | | evaluationScene.clear() |
| | | evaluationScene.index = i |
| | | evaluationScene.setDefaultScene(scene) |
| | | do { |
| | | callback(i, evaluationScene) |
| | | } while (evaluationScene.gotoNextSubTask()) |
| | | } |
| | | } |
| | | 1 -> { |
| | |
| | | sceneSourceList.clear() |
| | | val taskSceneIdList = |
| | | aopDbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode) |
| | | taskSceneIdList.forEach { |
| | | println(it.name) |
| | | } |
| | | sceneSourceList.addAll(taskSceneIdList) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | //å·¡æ¥ä»»å¡ä¿¡æ¯ |
| | | 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) |
| | | }) |
| | | } |
| | | |
| | | //ç°åºå·¡æ¥ä¿¡æ¯ |
| | |
| | | */ |
| | | 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 |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | reScoreItem10: ReScoreItem10, |
| | | reScoreItem11: ReScoreItem11, |
| | | ) { |
| | | //æ£å¨è¿è¡è¯ä¼°çå·¡æ¥ä»»å¡ |
| | | private val runningSubtask = mutableListOf<String>() |
| | | |
| | | //æ£å¨è¿è¡è¯ä¼°çæ»å·¡æ¥ä»»å¡ |
| | | private val runningTopTask = mutableListOf<String>() |
| | | |
| | | //ç¹å®è¯å项ï¼é¤äºç»ä¸çæ ¹æ®å·¡æ¥é®é¢ç´æ¥æ£åå¤ï¼æç¹å®çæ£åé»è¾çè¯ä¼°é¡¹ï¼ |
| | | private val itemList = mutableListOf<ScoreItem>() |
| | |
| | | * 对ç¹å®çå·¡æ¥ä»»å¡è¿è¡åç¬è¯å |
| | | */ |
| | | 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 { |
| | |
| | | /** |
| | | * è®¡ç®æ»å |
| | | */ |
| | | 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 |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDateTime |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼°ä»»å¡ç®¡ç |
| | |
| | | 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 { |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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/datafetch/FetchController.kt ÐÞ¸Ä |
| | |
| | | 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/datafetch/FetchData.kt ÐÞ¸Ä |
| | |
| | | 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/datafetch/FetchNightConstruction.kt ÐÞ¸Ä |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | } |
| | | utilFile.index = 1 |
| | | } |
| | | utilFile.outPutToFile() |
| | | utilFile.outPutToFile(distance) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | } |
| | | } |
| | |
| | | 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.* |
| | |
| | | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | 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}]对åºäºå¤æ¡è¯ä¼°æ»åè®°å½ï¼è¯·æ£æ¥æ¯å¦æç³»ç»é»è¾é误") |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥æ¾èªå¨è¯åç»æ |
| | |
| | | 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.* |
| | |
| | | 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) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | fun findBySubTask(subTaskId: String): Scense? { |
| | | val subtask = subTaskRep.find(subTaskId) |
| | | val subtask = subTaskRep.findOne(subTaskId) |
| | | return scenseMapper.selectByPrimaryKey(subtask?.scenseid) |
| | | } |
| | | } |
| | |
| | | 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) |
| | | } |
| | | } |
| | |
| | | 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.* |
| | | |
| | |
| | | endtime = Date.from(mEnd.atZone(ZoneId.systemDefault()).toInstant()) |
| | | } |
| | | } |
| | | |
| | | fun update(task: Task): Int { |
| | | return taskMapper.updateByPrimaryKeySelective(task) |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾ä¸ä¸ªæ»ä»»å¡ |
| | | */ |
| | |
| | | return taskMapper.select(example) |
| | | } |
| | | |
| | | fun findTasks(task: Task): List<Task?> { |
| | | return taskMapper.select(task) |
| | | } |
| | | |
| | | /** |
| | | * è·åæ»ä»»å¡å¯¹åºççç®¡çæ¬ |
| | | */ |
| | |
| | | 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() |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | 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> |
| | | } |
| | |
| | | |
| | | //æ°å¢åªä½æä»¶ |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | 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) |
| | |
| | | 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 |
| | |
| | | private val subtaskMapper: SubtaskMapper, |
| | | private val aopEvaluation: AopEvaluation, |
| | | private val taskRep: TaskRep, |
| | | private val subTaskRep: SubTaskRep, |
| | | ) : SubtaskService { |
| | | |
| | | val dateUtil = DateUtil() |
| | |
| | | // //æ ¹æ®æ¥æè·åæ¥ä»»å¡ |
| | | // val daytaskVo = taskService.findByDate(dateUtil.getDate(subtask.planstarttime)!!) |
| | | |
| | | //2019.3.1 by Riku åºè¯¥ç´æ¥æ ¹æ®åä»»å¡çæ¥ä»»å¡idæ¥è¯¢æ¥ä»»å¡ |
| | | //åºè¯¥ç´æ¥æ ¹æ®åä»»å¡çæ¥ä»»å¡idæ¥è¯¢æ¥ä»»å¡ |
| | | val daytaskVo = taskService.findByID(subtask.tsguid!!) |
| | | |
| | | //夿æ¯å¦ææ¥ä»»å¡ |
| | |
| | | } |
| | | |
| | | //夿坹åºé¡¶å±ä»»å¡çæ§è¡ç¶æ |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | 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) |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | 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>() |
| | |
| | | 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 -> "严éä¸è§è" |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | | } |
| | |
| | | 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 |
| | |
| | | |
| | | @ApiOperation("è·åæç±»åºæ¯çå·¡æ¥ä»»å¡ç»è®¡ä¿¡æ¯") |
| | | @PostMapping("/summary/area") |
| | | fun getSummaryByArea( |
| | | fun getTaskProgressByArea( |
| | | @RequestBody areaVo: AreaVo, |
| | | ) = subtaskService.getSummaryByArea(areaVo) |
| | | ) = resPack { subtaskService.getTaskProgressByArea(areaVo) } |
| | | |
| | | @ApiOperation("è·åæä¸ªåºæ¯çå·¡æ¥ä»»å¡") |
| | | @GetMapping("/byScene") |
| | |
| | | @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) } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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()) |
| | | } |
| | | } |
| | |
| | | |
| | | # 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 å¤ä¸ªæ¥å£æ¶éå·éå¼ |
| | |
| | | |
| | | #loggingè·¯å¾è®¾ç½® |
| | | logging: |
| | | config: classpath:log4j2.xml |
| | | # config: classpath:log4j2.xml |
| | | level: |
| | | cn.flightfeather.supervision.domain: debug |
| | | |
| | | springfox: |
| | | documentation: |
| | |
| | | <!--ç¶åå®ä¹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> |
| | |
| | | <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"/> |
| | |
| | | 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, |
| | |
| | | <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" > |
| | |
| | | <result column="ST_Remark" property="remark" jdbcType="VARCHAR" /> |
| | | </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> |
| | | |
| | | <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="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="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="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_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="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 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"> |
| | |
| | | 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}]]> |
| | |
| | | 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} |
| | |
| | | and b.S_TypeID = #{param2} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSummary" resultMap="SubTaskSummary"> |
| | | SELECT |
| | | a.ST_GUID, |
| | |
| | | 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, |
| | |
| | | GROUP BY |
| | | a.ST_GUID |
| | | </select> |
| | | |
| | | <select id="getSummaryByScene" resultMap="SubTaskSummary"> |
| | | SELECT |
| | | a.ST_GUID, |
| | |
| | | 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.* |
| | |
| | | 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 |
| | |
| | | @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) |
| | | |
| | |
| | | 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, |
| | |
| | | districtCode = districtCode, |
| | | sceneType = sceneType), mode) |
| | | } |
| | | |
| | | @Test |
| | | fun aopSubtask() { |
| | | val s = subTaskRep.findOne("yMRHdPg7e4i8M6aB") |
| | | aopEvaluation.executeBySubTask(s!!) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @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/datafetch/FetchNightConstructionTest.kt ÐÞ¸Ä |
| | |
| | | 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 |
| | |
| | | // 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) |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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() |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | } |
| | | } |