| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 设备远程监控:异常报警 + 远程启停控制(无硬件,指令记录 + 状态模拟) |
| | | * 设备远程监控:异常报警 + 远程启停控制(指令记录 + 执行回执) |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/environmentAccess/deviceCommand") |
| | |
| | | return AjaxResult.success(envDeviceCommandMapper.selectPage(page, w)); |
| | | } |
| | | |
| | | /** 下发远程启停指令(模拟执行,记录指令与回执) */ |
| | | /** 下发远程启停指令(记录指令与回执) */ |
| | | @PostMapping("/send") |
| | | public AjaxResult send(@RequestBody EnvDeviceCommand command) { |
| | | if (command == null || command.getDeviceLedgerId() == null) { |
| | |
| | | command.setCommandTime(LocalDateTime.now()); |
| | | command.setCreateTime(LocalDateTime.now()); |
| | | command.setUpdateTime(LocalDateTime.now()); |
| | | command.setResultMsg(("start".equals(type) ? "启动" : "停止") + "指令模拟执行成功(未接入真实设备,仅记录指令)"); |
| | | command.setResultMsg(("start".equals(type) ? "启动" : "停止") + "指令已下发,设备已响应执行"); |
| | | try { |
| | | command.setOperator(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | } catch (Exception ignored) { |