Merge branch 'limingyu-20240520-一公司摄像头显示bug' into pet

liujun-2024-05-23-接口漏洞修复
limingyu 2024-05-20 16:52:53 +08:00
commit 00e4c37c83
5 changed files with 122 additions and 2 deletions

View File

@ -0,0 +1,60 @@
package com.zcloud.controller.mkmj;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.mkmj.GateVideoService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools;
import com.zcloud.util.hk.HKUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* luoxiaobao
* 2021-05-10
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/gateVideo")
public class GateVideoController extends BaseController {
@Autowired
private GateVideoService gateVideoService;
@RequestMapping(value="/goAllVideo")
@ResponseBody
public Object goAllVideo() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String ArrayDATA_IDS[] = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS);
}
List<PageData> videoList = gateVideoService.listBo(pd); //根据ID读取
for (PageData video : videoList) {
if(video.get("INDEXCODE")!=null && !"".equals(video.getString("INDEXCODE"))){
Map<String, Object> data = HKUtil.camerasPreviewURLs(video.getString("INDEXCODE"), "hls");
video.put("HLSVIDEOURL", data);
Map<String, Object> resData = (Map<String, Object>) data.get("data");
video.put("GBSVIDEOURL",resData.get("url"));
}
}
map.put("videoList", videoList);
map.put("result", errInfo);
return map;
}
}

View File

@ -0,0 +1,23 @@
package com.zcloud.service.mkmj;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-05-10
* www.zcloudchina.com
*/
public interface GateVideoService {
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listBo(PageData pd)throws Exception;
}

View File

@ -0,0 +1,34 @@
package com.zcloud.service.mkmj.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.map.GateVideoMapper;
import com.zcloud.service.mkmj.GateVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-05-10
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class GateVideoServiceImpl implements GateVideoService {
@Autowired
private GateVideoMapper gateVideoMapper;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listBo(PageData pd)throws Exception{
return gateVideoMapper.listBo(pd);
}
}

View File

@ -146,14 +146,15 @@
bus_gatevideo v
LEFT JOIN mk_gate_area o on v.GATE_AREA_ID = o.GATE_AREA_ID
WHERE
v.isdelete = 0
v.isdelete = 0 and v.LATITUDE IS NOT NULL and v.LONGITUDE IS NOT NULL
<if test="AREA != null and AREA != ''">
and o.CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
</if>
<if test="CORP_INFO_ID != null and CORP_INFO_ID != ''">
and o.CORPINFO_ID = #{CORP_INFO_ID}
</if>
group by
v.GATEVIDEO_ID
</select>
<select id="getTodayInOutCount" resultType="com.zcloud.entity.PageData">
SELECT

View File

@ -258,6 +258,8 @@
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
and o.CORPINFO_ID = #{CORPINFO_ID}
</if>
GROUP BY
v.GATEVIDEO_ID
</select>
</mapper>