瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

xuxiaofei 3 年之前
父節點
當前提交
dfd1a878f7

+ 15 - 1
zd-modules/zd-algorithm/pom.xml

@@ -55,8 +55,22 @@
         <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
-            <version>3.10.0</version>
+            <version>4.9.0</version>
         </dependency>
+
+        <!-- okhttp-digest -->
+        <dependency>
+            <groupId>com.burgstaller</groupId>
+            <artifactId>okhttp-digest</artifactId>
+            <version>2.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.kxml</groupId>
+            <artifactId>kxml2</artifactId>
+            <version>2.3.0</version>
+        </dependency>
+
         <!-- mybatis plus -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 22 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubMangerController.java

@@ -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

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabBuildFloorMapper.xml

@@ -109,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join lab_build_floor_layout l on t.id = l.floor_id
         left join lab_subject s on l.sub_id = s.id and (s.admin_id = #{adminId} or find_in_set(#{adminId}, s.safe_user_id))
         <where>
+            AND l.`id` IS NOT NULL
             <if test="parentId != null "> and t.parent_id = #{parentId}</if>
             <if test="type != null "> and t.`type` = #{type}</if>
         </where>