Browse Source

球场管理添加字段

bihuisong 6 months ago
parent
commit
c98519f6b6

+ 5 - 22
qmjszx-business/src/main/java/beilv/hik/controller/AppHikController.java

@@ -3,18 +3,8 @@ package beilv.hik.controller;
 
 import beilv.common.core.domain.AjaxResult;
 import beilv.hik.controller.utils.GetCameraPreviewURL;
-import beilv.hik.controller.utils.GetCameras;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/app-api/hik")
@@ -31,18 +21,11 @@ public class AppHikController {
     /**
      * 根据userId查询用户积分流水列表
      */
-    @GetMapping("/getCameraPreviewURL")
+    @GetMapping("/getCameraPreviewURL/{cameraIndexCode}")
     @ResponseBody
-    public AjaxResult getCameraPreviewURL() {
-        List<String> urlList = new ArrayList<>();
-        List<Map<String, Object>> cameras = GetCameras.getCameras(host, appKey, appSecret);
-        if (!CollectionUtils.isEmpty(cameras)) {
-            for (Map<String, Object> map : cameras) {
-                String url = GetCameraPreviewURL.getCameraPreviewURL(host, appKey, appSecret, map.get("cameraIndexCode").toString());
-                urlList.add(url);
-            }
-        }
-        return AjaxResult.success(urlList);
+    public AjaxResult getCameraPreviewURL(@PathVariable("cameraIndexCode") String cameraIndexCode) {
+        String cameraPreviewURL = GetCameraPreviewURL.getCameraPreviewURL(host, appKey, appSecret, cameraIndexCode);
+        return AjaxResult.success("操作成功",cameraPreviewURL);
     }
 
 }

+ 14 - 0
qmjszx-business/src/main/java/beilv/site/domain/BeilvSite.java

@@ -56,6 +56,10 @@ public class BeilvSite extends BaseEntity
     @Excel(name = "场馆id")
     private Long venueId;
 
+    /** 监控点 */
+    @Excel(name = "监控点")
+    private String cameraIndexCode;
+
     private String venueName;
 
     private String userId;
@@ -154,6 +158,15 @@ public class BeilvSite extends BaseEntity
         return venueId;
     }
 
+
+    public String getCameraIndexCode() {
+        return cameraIndexCode;
+    }
+
+    public void setCameraIndexCode(String cameraIndexCode) {
+        this.cameraIndexCode = cameraIndexCode;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -166,6 +179,7 @@ public class BeilvSite extends BaseEntity
             .append("warmReminder", getWarmReminder())
             .append("siteStatus", getSiteStatus())
             .append("venueId", getVenueId())
+            .append("cameraIndexCode", getCameraIndexCode())
             .toString();
     }
 }

+ 7 - 1
qmjszx-business/src/main/resources/mapper/site/BeilvSiteMapper.xml

@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="businessHours"    column="business_hours"    />
         <result property="address"    column="address"    />
         <result property="phoneNumber"    column="phone_number"    />
+        <result property="cameraIndexCode"    column="camera_index_code"    />
     </resultMap>
 
     <sql id="selectBeilvSiteVo">
-        select id, name, site_type, cover, intro, price, warm_reminder, site_status, venue_id from beilv_site
+        select id, name, site_type, cover, intro, price, warm_reminder, site_status, venue_id, camera_index_code from beilv_site
     </sql>
 
     <select id="selectBeilvSiteList" parameterType="BeilvSite" resultMap="BeilvSiteResult">
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         bs.warm_reminder,
         bs.site_status,
         bs.venue_id,
+        bs.camera_index_code,
         bv.venue_name,
         bv.business_hours,
         bv.address,
@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             bs.warm_reminder,
             bs.site_status,
             bs.venue_id,
+            bs.camera_index_code,
             bv.venue_name
         FROM
             beilv_site bs
@@ -78,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="warmReminder != null">warm_reminder,</if>
             <if test="siteStatus != null">site_status,</if>
             <if test="venueId != null">venue_id,</if>
+            <if test="cameraIndexCode != null">camera_index_code,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
@@ -88,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="warmReminder != null">#{warmReminder},</if>
             <if test="siteStatus != null">#{siteStatus},</if>
             <if test="venueId != null">#{venueId},</if>
+            <if test="cameraIndexCode != null">#{venueId},</if>
          </trim>
     </insert>
 
@@ -102,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="warmReminder != null">warm_reminder = #{warmReminder},</if>
             <if test="siteStatus != null">site_status = #{siteStatus},</if>
             <if test="venueId != null">venue_id = #{venueId},</if>
+            <if test="cameraIndexCode != null">camera_index_code = #{cameraIndexCode},</if>
         </trim>
         where id = #{id}
     </update>