diff --git a/src/main/java/com/qyft/gd/device/controller/TestController.java b/src/main/java/com/qyft/gd/device/controller/TestController.java index efb0734..dc24dc3 100644 --- a/src/main/java/com/qyft/gd/device/controller/TestController.java +++ b/src/main/java/com/qyft/gd/device/controller/TestController.java @@ -211,8 +211,8 @@ public class TestController { @Operation(summary = "停止加热") @GetMapping("/stopHeating") - public Result stopHeating() { - boolean success = deviceService.stopHeating(); + public Result stopHeating(@RequestParam String heaterId) { + boolean success = deviceService.stopHeating(heaterId); if (success) { return Result.success(); } else { diff --git a/src/main/java/com/qyft/gd/device/service/DeviceService.java b/src/main/java/com/qyft/gd/device/service/DeviceService.java index 0c5d0fa..29eefbd 100644 --- a/src/main/java/com/qyft/gd/device/service/DeviceService.java +++ b/src/main/java/com/qyft/gd/device/service/DeviceService.java @@ -288,9 +288,12 @@ public class DeviceService { /** * 停止加热 + * @param heaterId 加热器id */ - public boolean stopHeating() { - DeviceFeedback deviceFeedback = tcpClient.sendCommand("stopHeating"); + public boolean stopHeating(String heaterId) { + Map params = new HashMap<>(); + params.put("heaterId", heaterId); + DeviceFeedback deviceFeedback = tcpClient.sendCommand("stopHeating", params); if (deviceFeedback == null || deviceFeedback.getError() != null) { log.error("TCP stopHeating 指令执行错误 {}", JSONUtil.toJsonStr(deviceFeedback)); return false;