parent
244599f817
commit
73bbd006d0
|
@ -37,7 +37,7 @@ public class Controller {
|
||||||
private CameraChannelMapper cameraChannelMapper;
|
private CameraChannelMapper cameraChannelMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CameraOrgenMapper cameraOrgenMapper;
|
private CameraOrgenizationMapper cameraOrgenMapper;
|
||||||
|
|
||||||
@RequestMapping("all")
|
@RequestMapping("all")
|
||||||
public Object all(){
|
public Object all(){
|
||||||
|
@ -106,10 +106,15 @@ public class Controller {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("selectById")
|
/**
|
||||||
public Result selectById(String idtCameraChannel){
|
* 根据parentId查询摄像头
|
||||||
|
* @param parentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("selectByParentId")
|
||||||
|
public Result selectByParentId(String parentId){
|
||||||
|
|
||||||
List<String> list = cameraChannelMapper.selectById(idtCameraChannel);
|
List<CameraChannel> list = cameraChannelMapper.selectByParentId(parentId);
|
||||||
|
|
||||||
Result success = Result.success(list);
|
Result success = Result.success(list);
|
||||||
|
|
||||||
|
@ -152,12 +157,12 @@ public class Controller {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("selectSubOrgan")
|
@RequestMapping("selectSubOrgan")
|
||||||
public Result selectSubOrgan(String parentId){
|
public Result selectSubOrganization(String parentId){
|
||||||
if (parentId == null){
|
if (parentId == null){
|
||||||
parentId = "";
|
parentId = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CameraOrgan> organs = cameraOrgenMapper.selectSubOrgan(parentId);
|
List<CameraOrganization> organs = cameraOrgenMapper.selectSubOrganization(parentId);
|
||||||
|
|
||||||
Result success = Result.success(organs);
|
Result success = Result.success(organs);
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("t_camera_organ")
|
@TableName("t_camera_organization")
|
||||||
public class CameraOrgan {
|
public class CameraOrganization {
|
||||||
@TableId
|
@TableId
|
||||||
private String id;
|
private String id;
|
||||||
|
|
|
@ -16,8 +16,8 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
|
||||||
"OR c.gps_y NOT IN('0.0','0','')) AND c.status != 0")
|
"OR c.gps_y NOT IN('0.0','0','')) AND c.status != 0")
|
||||||
List<CameraChannel> selectAll(CameraChannel cameraChannel);
|
List<CameraChannel> selectAll(CameraChannel cameraChannel);
|
||||||
|
|
||||||
@Select("select * from t_camera_channel where idt_camera_channel = #{idtCameraChannel}")
|
@Select("select * from t_camera_channel where parent_id = #{parentId}")
|
||||||
List<String> selectById(@Param("idtCameraChannel") String idtCameraChannel);
|
List<CameraChannel> selectByParentId(@Param("parentId") String parentId);
|
||||||
|
|
||||||
@Select("select * from (select a.*,c.* from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " +
|
@Select("select * from (select a.*,c.* from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " +
|
||||||
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code ) m where m.label_code = #{labelCode} ")
|
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code ) m where m.label_code = #{labelCode} ")
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.hisense.monitormanage.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.hisense.monitormanage.entity.CameraOrgan;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface CameraOrgenMapper extends BaseMapper<CameraOrgan> {
|
|
||||||
|
|
||||||
@Select("select * from t_camera_organ where parent_id = #{parentId}")
|
|
||||||
List<CameraOrgan> selectSubOrgan(@Param("parentId") String parentId);
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.hisense.monitormanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.hisense.monitormanage.entity.CameraOrganization;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CameraOrgenizationMapper extends BaseMapper<CameraOrganization> {
|
||||||
|
|
||||||
|
@Select("select * from t_camera_organization where parent_id = #{parentId}")
|
||||||
|
List<CameraOrganization> selectSubOrganization(@Param("parentId") String parentId);
|
||||||
|
}
|
|
@ -2,7 +2,6 @@ package com.hisense.monitormanage.service;
|
||||||
|
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hisense.monitormanage.entity.*;
|
import com.hisense.monitormanage.entity.*;
|
||||||
|
@ -20,7 +19,6 @@ import org.springframework.util.Base64Utils;
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
@ -57,7 +55,7 @@ public class MonitorService {
|
||||||
private CameraChannelMapper cameraChannelMapper;
|
private CameraChannelMapper cameraChannelMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CameraOrgenMapper cameraOrgenMapper;
|
private CameraOrgenizationMapper cameraOrgenMapper;
|
||||||
|
|
||||||
@Value("${hwx.file.work-path}")
|
@Value("${hwx.file.work-path}")
|
||||||
private String fileDir;
|
private String fileDir;
|
||||||
|
@ -336,16 +334,16 @@ public class MonitorService {
|
||||||
Boolean isParent = (Boolean) result.get("isParent");
|
Boolean isParent = (Boolean) result.get("isParent");
|
||||||
|
|
||||||
if (isParent){
|
if (isParent){
|
||||||
CameraOrgan cameraOrgan = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrgan.class);
|
CameraOrganization cameraOrganization = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrganization.class);
|
||||||
|
|
||||||
cameraOrgenMapper.insert(cameraOrgan);
|
cameraOrgenMapper.insert(cameraOrganization);
|
||||||
|
|
||||||
videoService((String) result.get("id"),path + sep + result.get("name"));
|
videoService((String) result.get("id"),path + sep + result.get("name"));
|
||||||
}else {
|
}else {
|
||||||
if (result.get("channelId") != null){
|
if (result.get("channelId") != null){
|
||||||
CameraChannel cameraChannel = JSONObject.parseObject(JSONObject.toJSONString(result), CameraChannel.class);
|
CameraChannel cameraChannel = JSONObject.parseObject(JSONObject.toJSONString(result), CameraChannel.class);
|
||||||
|
|
||||||
String id = (String)result.get("parentId");
|
String id = (String)result.get("orgCode");
|
||||||
|
|
||||||
if (path != null && path.startsWith(sep)) {
|
if (path != null && path.startsWith(sep)) {
|
||||||
path = path.substring(sep.length());
|
path = path.substring(sep.length());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hisense.monitormanage.mapper.CameraOrgenMapper">
|
<mapper namespace="com.hisense.monitormanage.mapper.CameraOrgenizationMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue