From 0392c333ed3d987cb2ab3dac4e1a972cff405f21 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 25 四月 2024 17:42:08 +0800 Subject: [PATCH] 1. 新增后台任务关联模块 2. 新增自动评分后台任务; 3. 修复部分bug --- src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt index 21c7c54..8bb3c96 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt @@ -4,8 +4,12 @@ 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 import org.springframework.web.bind.annotation.* +import java.time.LocalDateTime @Api(tags = ["SubtaskController"], description = "宸℃煡瀛愪换鍔PI鎺ュ彛") @RestController @@ -58,8 +62,29 @@ @GetMapping("/getSubTask") fun getByTopTaskAndDate( @RequestParam("topTaskId") topTaskId: String, - @RequestParam("startTime") startTime: String, - @RequestParam("endTime") endTime: String, + @RequestParam(value = "startTime", required = false) startTime: String?, + @RequestParam(value = "endTime", required = false) endTime: String?, @RequestParam(value = "sceneTypeId", required = false) sceneTypeId: Int? ) = subtaskService.getByTopTaskAndDate(topTaskId, startTime, endTime, sceneTypeId) + + @ApiOperation("鑾峰彇鏌愮被鍦烘櫙鐨勫贰鏌ヤ换鍔$粺璁′俊鎭�") + @GetMapping("/summary") + fun getByTopTaskAndDate( + @RequestParam("topTaskId") topTaskId: String, + @RequestParam(value = "sceneTypeId", required = false) sceneTypeId: Int? + ) = subtaskService.getSummary(topTaskId, sceneTypeId) + + @ApiOperation("鑾峰彇鏌愮被鍦烘櫙鐨勫贰鏌ヤ换鍔$粺璁′俊鎭�") + @PostMapping("/summary/area") + fun getSummaryByArea( + @RequestBody areaVo: AreaVo, + ) = subtaskService.getSummaryByArea(areaVo) + + @ApiOperation("鑾峰彇鏌愪釜鍦烘櫙鐨勫贰鏌ヤ换鍔�") + @GetMapping("/byScene") + fun getByScene( + @RequestParam sceneId: String, + @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) } \ No newline at end of file -- Gitblit v1.9.3