| | |
| | | */ |
| | | package org.springblade.jfpt.equipment.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.*; |
| | |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVO; |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVOS; |
| | | import org.springblade.jfpt.equipment.wrapper.EqWrapper; |
| | | import org.springblade.jfpt.hk.constant.HkConstant; |
| | | import org.springblade.jfpt.hk.constant.ProtocolConstant; |
| | | import org.springblade.jfpt.hk.util.GetCameraPreviewURL; |
| | | import org.springblade.system.entity.Region; |
| | | import org.springblade.system.user.entity.User; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | //返回 |
| | | return R.data(equipmentService.selectEquimentPlayInfo(equipmentPlayInfo)); |
| | | // equipmentService.selectEquimentPlayInfo(equipmentPlayInfo) |
| | | |
| | | JSONObject res = new JSONObject(); |
| | | |
| | | //根据设备id获取设备编号 |
| | | String result1 = GetCameraPreviewURL.QueryCameraPreviewURL(HkConstant.camerasID, equipmentPlayInfo.getNumber(), "encodeDevice", "deviceCode"); |
| | | |
| | | JSONObject jsonObject1 = JSONObject.parseObject(result1); |
| | | JSONObject res1 = (JSONObject) jsonObject1.get("data"); |
| | | JSONArray arr1 = JSON.parseArray(res1.getString("list")); |
| | | if (arr1.size() > 0){ |
| | | JSONObject data1 = (JSONObject) arr1.get(0); |
| | | String code1 = data1.get("indexCode").toString(); |
| | | |
| | | //根据设备编号获取子节点编号 |
| | | String result2 = GetCameraPreviewURL.QueryCameraPreviewURL(HkConstant.camerasID, code1, "camera", "parentIndexCode"); |
| | | |
| | | JSONObject jsonObject2 = JSONObject.parseObject(result2); |
| | | JSONObject res2 = (JSONObject) jsonObject2.get("data"); |
| | | JSONArray arr2 = JSON.parseArray(res2.getString("list")); |
| | | JSONObject data2 = (JSONObject) arr2.get(0); |
| | | String code2 = data2.get("indexCode").toString(); |
| | | |
| | | //根据子节点编号获取设备播放地址 |
| | | String result3 = GetCameraPreviewURL.GetCameraPreviewURL(HkConstant.previewURLs, code2, ProtocolConstant.HLS); |
| | | res = JSONObject.parseObject(result3); |
| | | } |
| | | |
| | | return R.data(res); |
| | | } |
| | | |
| | | |