|
|
@@ -135,6 +135,28 @@ public class LabSubMangerController extends BaseController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
+ * 控制通风厨开关
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation("控制通风厨开关")
|
|
|
+ @PreAuthorize(hasPermi = PerPrefix.LABORATORY_SUBCONTROL + PerFun.SET)
|
|
|
+ @PostMapping("/controlSwitch/{id}")
|
|
|
+ public ResultData controlSwitch(@PathVariable("id") @ApiParam("设备ID") Long id) {
|
|
|
+ Boolean control = false;
|
|
|
+ try {
|
|
|
+ control = subjectManagerService.control(id, Symbol.command.open);
|
|
|
+ Thread.sleep(500);
|
|
|
+ control = subjectManagerService.control(id, Symbol.command.close);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return ResultData.result(control,()->"电源控制失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 智能报警设备开关
|
|
|
*
|
|
|
* @return
|