From 4e20a1aaaba1bb843820fca844c20055a33febce Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 19 七月 2024 17:39:19 +0800 Subject: [PATCH] 1. 新增webSocket相关功能 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt | 17 +++++++++++++++-- 1 files changed, 15 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 dca0a62..cf2670e 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt @@ -1,5 +1,8 @@ package cn.flightfeather.supervision.lightshare.web +import cn.flightfeather.supervision.common.log.BizLog +import cn.flightfeather.supervision.common.log.WorkStreamLogInfo +import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.Subtask import cn.flightfeather.supervision.lightshare.service.SubtaskService import cn.flightfeather.supervision.lightshare.vo.AreaVo @@ -13,7 +16,7 @@ @Api(tags = ["SubtaskController"], description = "宸℃煡瀛愪换鍔PI鎺ュ彛") @RestController @RequestMapping("/subtask") -class SubtaskController(val subtaskService: SubtaskService) { +class SubtaskController(val subtaskService: SubtaskService, private val bizLog: BizLog) { @GetMapping fun getAll() = subtaskService.findAll() @@ -24,7 +27,17 @@ fun addList(@RequestBody subtasklist: List<Subtask>) = subtaskService.saveList(subtasklist) @PostMapping - fun update(@RequestBody subtask: Subtask) = subtaskService.update(subtask) + fun update(@RequestBody subtask: Subtask): Int { + val res = subtaskService.update(subtask) + if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text) { + val event = "鍦�${subtask.scensename}缁撴潫宸℃煡" + bizLog.info(WorkStreamLogInfo(subtask.executorguids, subtask.executorrealtimes, event)) + }else if (subtask.status == Constant.TaskProgress.RUNINGSTATUS2.text) { + val event = "鍦�${subtask.scensename}寮�濮嬪贰鏌�" + bizLog.info(WorkStreamLogInfo(subtask.executorguids, subtask.executorrealtimes, event)) + } + return res + } @GetMapping("/{id}") fun getById(@PathVariable id: String) = subtaskService.findByID(id) -- Gitblit v1.9.3