Compare commits

..

3 Commits

Author SHA1 Message Date
6e1cf8aafb Merge branch 'master' into dev_fire 2022-03-04 20:30:21 +08:00
36e9d31941 初始化火情事件表 2022-03-04 17:29:00 +08:00
39ea504f16 订阅大华火情事件 2022-03-04 16:40:48 +08:00
21 changed files with 353 additions and 1263 deletions

View File

@ -192,7 +192,7 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
<!-- <scope>provided</scope>--> <scope>provided</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/redis.clients/jedis --> <!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
@ -201,11 +201,6 @@
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>3.7.0</version> <version>3.7.0</version>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool-all.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>

View File

@ -1,21 +1,12 @@
package com.xkrs; package com.xkrs;
import com.alibaba.fastjson.JSON;
import com.xkrs.model.vo.ADD;
import com.xkrs.model.vo.DA;
import com.xkrs.service.CameraService;
import com.xkrs.service.impl.CameraServiceImpl;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jms.annotation.EnableJms; import org.springframework.jms.annotation.EnableJms;
import javax.annotation.Resource;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* 启动类 * 启动类
*
* @author XinYi Song * @author XinYi Song
**/ **/
@SpringBootApplication @SpringBootApplication
@ -24,7 +15,6 @@ import java.util.List;
public class SmartUrbanRuralApplication { public class SmartUrbanRuralApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(SmartUrbanRuralApplication.class, args); SpringApplication.run(SmartUrbanRuralApplication.class, args);
} }

View File

@ -1,12 +1,9 @@
package com.xkrs.controller; package com.xkrs.controller;
import com.alibaba.fastjson.JSON;
import com.xkrs.dao.CameraDao; import com.xkrs.dao.CameraDao;
import com.xkrs.dao.DeviceManagementDao; import com.xkrs.dao.DeviceManagementDao;
import com.xkrs.model.entity.CameraInformation; import com.xkrs.model.entity.CameraInformation;
import com.xkrs.model.entity.DeviceManagement; import com.xkrs.model.entity.DeviceManagement;
import com.xkrs.model.vo.ADD;
import com.xkrs.model.vo.DA;
import com.xkrs.service.CameraService; import com.xkrs.service.CameraService;
import com.xkrs.service.FireService; import com.xkrs.service.FireService;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -14,8 +11,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,7 +28,6 @@ public class CameraController {
@Resource @Resource
private DeviceManagementDao deviceManagementDao; private DeviceManagementDao deviceManagementDao;
@GetMapping("/getCameraInformation") @GetMapping("/getCameraInformation")
public List<CameraInformation> getCameraInformation(){ public List<CameraInformation> getCameraInformation(){
@ -50,85 +44,12 @@ public class CameraController {
return false; return false;
} }
} }
/**
* 返回全部信息
* @param
* @return
*/
@GetMapping("/findEquipment1")
public String Selectequipment(){
try
{
return cameraService.Selectequipment();
}
catch (Exception E)
{
return E.getMessage();
}
}
/**
* 查询实时视频连接
* @return
*/
@GetMapping("/findVideoPath1")
public String selectVideotape(){
try {
return cameraService.Videotape();
}
catch (Exception e){
return e.getMessage();
}
}
/**
* 添加设备信息
* @return
*/
@GetMapping("/SelectDeviceManagement") @GetMapping("/SelectDeviceManagement")
public String SelectDeviceManagement() public List<DeviceManagement> SelectDeviceManagement()
{ {
File file = new File("C:\\Users\\HP\\Desktop\\摄像头设备信息.txt"); return cameraService.SelectDevice();
try {
BufferedReader br=new BufferedReader(new FileReader(file));
String contnetTotal="";
String s;
while (( s=br.readLine())!=null){
contnetTotal+=s;
}
br.close();
DA tempBran = JSON.parseObject(contnetTotal, DA.class);
List<DA.DataDTO.PageDataDTO> pageData = tempBran.getData().getPageData();
for (DA.DataDTO.PageDataDTO item: pageData) {
DeviceManagement add=new DeviceManagement();
add.setDeviceName(item.getDeviceName());
add.setDeviceCode(item.getDeviceCode());
add.setDeviceSn(item.getDeviceSn());
add.setDeviceCategory(item.getDeviceCategory());
add.setDeviceManufacturer(item.getDeviceManufacturer());
add.setDeviceType(item.getDeviceType());
add.setDeviceModel(item.getDeviceModel());
add.setDeviceIp(item.getDeviceIp());
add.setDevicePort(item.getDevicePort());
add.setOwnerCode(item.getOwnerCode());
add.setLiveVideo("http://111.53.13.180:7086/live/cameraid/"+item.getDeviceCode()+ "%240/substream/1.m3u8");
add.setIsOnline(item.getIsOnline());
add.setUpdateTime(item.getOnlineUpdateTime());
deviceManagementDao.save(add);
}
System.out.println("111");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "1";
} }
} }

View File

@ -3,15 +3,11 @@ package com.xkrs.controller;
import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.EquipmentDao; import com.xkrs.dao.EquipmentDao;
import com.xkrs.dao.FireDao; import com.xkrs.dao.FireDao;
import com.xkrs.model.entity.Fire;
import com.xkrs.service.FireService; import com.xkrs.service.FireService;
import com.xkrs.util.Query;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -40,6 +36,7 @@ public class FireController {
/** /**
* 根据设备编号获取火情信息 * 根据设备编号获取火情信息
*
* @param code * @param code
* @return * @return
*/ */
@ -50,6 +47,7 @@ public class FireController {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -62,6 +60,7 @@ public class FireController {
/** /**
* 查询最新的300条火情信息 * 查询最新的300条火情信息
*
* @return * @return
*/ */
@GetMapping("/findThreeHundredData") @GetMapping("/findThreeHundredData")
@ -71,6 +70,7 @@ public class FireController {
/** /**
* 查询一个月中每一天各个街道的火情数量 * 查询一个月中每一天各个街道的火情数量
*
* @param beginTime * @param beginTime
* @param endTime * @param endTime
* @return * @return
@ -86,6 +86,7 @@ public class FireController {
/** /**
* 查询一年中每个月的各个街道的火情数量 * 查询一年中每个月的各个街道的火情数量
*
* @param beginTime * @param beginTime
* @param endTime * @param endTime
* @return * @return
@ -101,6 +102,7 @@ public class FireController {
/** /**
* 修改火点状态 * 修改火点状态
*
* @param map * @param map
* @return * @return
*/ */
@ -113,6 +115,7 @@ public class FireController {
/** /**
* 查询已处理和未处理的火点的数量 * 查询已处理和未处理的火点的数量
*
* @param street * @param street
* @param month * @param month
* @return * @return
@ -128,4 +131,5 @@ public class FireController {
map.put("notProcessed", notprocessed); map.put("notProcessed", notprocessed);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale);
} }
} }

View File

@ -4,38 +4,31 @@ import com.dahuatech.icc.event.model.v202011.EventSubscribeRequest;
import com.dahuatech.icc.event.model.v202011.EventSubscribeResponse; import com.dahuatech.icc.event.model.v202011.EventSubscribeResponse;
import com.dahuatech.icc.oauth.http.DefaultClient; import com.dahuatech.icc.oauth.http.DefaultClient;
import com.dahuatech.icc.oauth.http.IClient; import com.dahuatech.icc.oauth.http.IClient;
import com.fasterxml.jackson.databind.JsonNode; import com.xkrs.service.FireEventService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.xkrs.common.encapsulation.PromptMessageEnum;
import org.apache.http.util.TextUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.IOException; import javax.annotation.Resource;
import java.util.Locale;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/** /**
* ./start.sh * @Author: XinYi Song
* sudo tail -f nohup.out * @Date: 2022/2/11 9:03
* /home/sxy/server/SmartUrbanRural
*/ */
@RestController @RestController
public class FireEventController { public class FireEventController {
Locale locale = LocaleContextHolder.getLocale(); @Resource
private FireEventService fireEventService;
/** /**
* 订阅火情事件 * 订阅火情事件
*/ */
@GetMapping("/subscribeFireEvent") @GetMapping("/subscribeFireEvent")
public String subscribeFireEvent() { public void subscribeFireEvent() {
try { try {
//118.24.27.47:6820
String host = "111.53.13.180:4433"; String host = "111.53.13.180:4433";
String username = "system"; String username = "system";
String password = "Admin@123"; String password = "Admin@123";
@ -50,41 +43,21 @@ public class FireEventController {
subscribeRequest.body(mqinfo); subscribeRequest.body(mqinfo);
EventSubscribeResponse subscribeResponse = iClient.doAction(subscribeRequest, subscribeRequest.getResponseClass()); EventSubscribeResponse subscribeResponse = iClient.doAction(subscribeRequest, subscribeRequest.getResponseClass());
System.out.println("----结束执行----{}------事件订阅" + subscribeResponse.toString()); System.out.println("----结束执行----{}------事件订阅" + subscribeResponse.toString());
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, subscribeResponse, locale);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "订阅火情事件失败", locale);
} }
/** /**
* 接收火情事件 * 接收火情事件
*/ */
@PostMapping("/receiveFireEvent") @PostMapping("/receiveFireEvent")
public void receiveFireEvent(@RequestBody String message) throws IOException { public void receiveFireEvent(@RequestBody Object fireEvent) {
JsonNode jsonNode = new ObjectMapper().readTree(message); try {
System.out.println("----接收火情事件----{}------" + fireEvent.toString());
String category = jsonNode.get("category").asText(); } catch (Exception e) {
String method = jsonNode.get("method").asText(); e.printStackTrace();
String subsystem = jsonNode.get("subsystem").asText();
String info = jsonNode.get("info").asText();
boolean fireEventForCategory = (!TextUtils.isEmpty(category)) && "alarm".equals(category);
boolean fireEventForMethod = (!TextUtils.isEmpty(method)) && "alarm.msg".equals(method);
boolean fireEventForSubsystem = (!TextUtils.isEmpty(subsystem)) && "admin".equals(subsystem);
boolean hasInfo = true;
//火情事件
if (fireEventForCategory && fireEventForMethod && fireEventForSubsystem && hasInfo) {
return;
} }
boolean firePictureForCategory = (!TextUtils.isEmpty(category)) && "business".equals(category);
boolean firePictureForMethod = (!TextUtils.isEmpty(method)) && "vms.notifyAlarmPicture".equals(method);
boolean firePictureForSubsystem = (!TextUtils.isEmpty(subsystem)) && "admin".equals(subsystem);
//火情图片
if (firePictureForCategory && firePictureForMethod && firePictureForSubsystem && hasInfo) {
return;
}
} }
/** /**
@ -92,7 +65,7 @@ public class FireEventController {
*/ */
@GetMapping("/selectFireEvent") @GetMapping("/selectFireEvent")
public String selectFireEvent() { public String selectFireEvent() {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "selectFireEvent", locale); return fireEventService.selectFireEventList();
} }
} }

View File

@ -1,127 +0,0 @@
package com.xkrs.controller;
public class Temp {
/**
* {
* "id":null,
* "category":"alarm",
* "method":"alarm.msg",
* "info":{
* "orgName":"热成像云台",
* "nodeCode":"1000042$1$0$1",
* "deviceCode":"1000042",
* "alarmCode":"{6E750E9B-9DB4-9C42-983F-B5117E2B8F67}",
* "alarmPicture":"",
* "nodeType":2,
* "deviceName":"固定桥村北",
* "alarmDate":"1646471854",
* "alarmGrade":2,
* "isSave":true,
* "unitType":1,
* "unitSeq":0,
* "extend":{
* "params":[
* {
* "fTemperature":0,
* "nDistance":1000,
* "nThermoHFOV":520,
* "nPresetId":1,
* "stuBoundingBox":{
* "nTop":4096,
* "nBottom":4369,
* "nLeft":3686,
* "nRight":3891
* },
* "stuFiringGPS":{
* "dbAltitude":0,
* "dwLatidude":0,
* "dwLongitude":0
* },
* "nThermoVFOV":390,
* "stuPTZPosition":{
* "nPositionX":2123,
* "nPositionY":2,
* "nZoom":1
* },
* "nTemperatureUnit":1,
* "fsid":2267,
* "fAltitude":150,
* "GPS_POINT":{
* "dwLatidude":39.873801,
* "dwLongitude":113.49956299999999
* }
* },
* {
* "fTemperature":0,
* "nDistance":1000,
* "nThermoHFOV":520,
* "nPresetId":1,
* "stuBoundingBox":{
* "nTop":5188,
* "nBottom":5461,
* "nLeft":1433,
* "nRight":2457
* },
* "stuFiringGPS":{
* "dbAltitude":0,
* "dwLatidude":0,
* "dwLongitude":0
* },
* "nThermoVFOV":390,
* "stuPTZPosition":{
* "nPositionX":2123,
* "nPositionY":2,
* "nZoom":1
* },
* "nTemperatureUnit":1,
* "fsid":2267,
* "fAltitude":150,
* "GPS_POINT":{
* "dwLatidude":39.873801,
* "dwLongitude":113.49956299999999
* }
* }
* ]
* },
* "alarmType":5122,
* "linkIds":"598970c2f97a422fbfeae77d02ffc8a5",
* "channelSeq":1,
* "orgCode":"001001",
* "channelName":"固定桥村北热成像",
* "alarmStat":1,
* "isEvent":false
* },
* "subsystem":"admin",
* "userIds":null,
* "sid":null,
* "domainId":null,
* "infoArray":null,
* "protocol":null
* }
*/
/**
* {
* "id":null,
* "category":"business",
* "method":"vms.notifyAlarmPicture",
* "info":{
* "chnName":"施家会村可见光",
* "pictureSize":"",
* "alarmCode":"{B73E8BD6-60A5-D549-80B8-B03FDB68C76F}",
* "alarmDate":"1646471804",
* "picture":"d7e12fe8-938d-11ec-9713-00ddb6910ecd/20220305/1/dsf_4d9cb367-9c5f-11ec-8e91-00ddb6910ecd_28749380_29339566.jpg"
* },
* "subsystem":"admin",
* "userIds":null,
* "sid":null,
* "domainId":null,
* "infoArray":null,
* "protocol":null
* }
*/
}

View File

@ -20,7 +20,10 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.util.*; import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@ -131,39 +134,35 @@ public class TestController {
* @return * @return
*/ */
@GetMapping("/getPaging") @GetMapping("/getPaging")
public String getPaging( String para) { public boolean getPaging( String para) {
String forecastWeather = ManagementUtil.getPaging(para); String forecastWeather = ManagementUtil.getPaging(para);
List<Map<String, String>> listObjectFir = (List<Map<String, String>>) JSONArray.parse(forecastWeather);
// List<Map<String, String>> listObjectFir = (List<Map<String, String>>) JSONArray.parse(forecastWeather); ObjectMapper objectMapper = new ObjectMapper();
// ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = null;
// JsonNode jsonNode = null; try {
// try { jsonNode = objectMapper.readTree(forecastWeather);
// jsonNode = objectMapper.readTree(forecastWeather); } catch (JsonProcessingException e) {
// } catch (JsonProcessingException e) { e.printStackTrace();
// e.printStackTrace(); }
// } String method = jsonNode.get("method").asText();
// List<DeviceManagement> item= new ArrayList<>(); if("vms.alarm.msg".equals(method)){
// String method = jsonNode.get("method").asText(); JsonNode info = jsonNode.get("info");
// if("vms.alarm.msg".equals(method)){ DeviceManagement fire = new DeviceManagement();
// JsonNode info = jsonNode.get("info"); fire.setDeviceName(info.get("deviceName").asText());
// DeviceManagement fire = new DeviceManagement(); fire.setDeviceCode(info.get("deviceCode").asText());
// fire.setDeviceName(info.get("deviceName").asText()); fire.setDeviceSn(info.get("deviceSn").asText());
// fire.setDeviceCode(info.get("deviceCode").asText()); fire.setDeviceCategory(Integer.valueOf(info.get("deviceCategory").asText()));
// fire.setDeviceSn(info.get("deviceSn").asText()); fire.setDeviceType(Integer.valueOf(info.get("deviceType").asText()));
// fire.setDeviceCategory(Integer.valueOf(info.get("deviceCategory").asText())); fire.setDeviceManufacturer(info.get("deviceManufacturer").asText());
// fire.setDeviceType(Integer.valueOf(info.get("deviceType").asText())); fire.setDeviceModel(info.get("deviceModel").asText());
// fire.setDeviceManufacturer(info.get("deviceManufacturer").asText()); fire.setDeviceIp(info.get("deviceIp").asText());
// fire.setDeviceModel(info.get("deviceModel").asText()); fire.setDevicePort(Integer.valueOf(info.get("devicePort").asText()));
// fire.setDeviceIp(info.get("deviceIp").asText()); fire.setOwnerCode(info.get("ownerCode").asText());
// fire.setDevicePort(Integer.valueOf(info.get("devicePort").asText())); //fire.setOwnerOrgName(Integer.valueOf(info.get("ownerOrgName").asText()));
// fire.setOwnerCode(info.get("ownerCode").asText()); fire.setIsOnline(Integer.valueOf(info.get("isOnline").asText()));
// //fire.setOwnerOrgName(Integer.valueOf(info.get("ownerOrgName").asText())); fire.setSubSystem(info.get("subSystem").asText());
//// fire.setIsOnline(Integer.valueOf(info.get("isOnline").asText())); fire.setDevExt(info.get("devExt").asText());
//// fire.setSubSystem(info.get("subSystem").asText()); }
//// fire.setDevExt(info.get("devExt").asText()); return true;
// item.add(fire);
// }
return forecastWeather;
} }
} }

View File

@ -2,13 +2,10 @@ package com.xkrs.dao;
import com.xkrs.model.entity.CameraInformation; import com.xkrs.model.entity.CameraInformation;
import com.xkrs.model.entity.DeviceManagement; import com.xkrs.model.entity.DeviceManagement;
import com.xkrs.model.vo.ADD;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
/** /**
@ -17,16 +14,11 @@ import java.util.Map;
*/ */
public interface DeviceManagementDao extends JpaRepository<DeviceManagement,Long> { public interface DeviceManagementDao extends JpaRepository<DeviceManagement,Long> {
/** /**
* 查询视频连接 * 添加设备分页信息
*/ */
@Query(value = "SELECT device_code,live_video FROM device_management",nativeQuery = true) @Query(value = "Insert device_management('','','','','','','','','','','','','','','','','') " +
List<Map<String,String>> Videotape(); "VALUES('?1','?2','?3','?4','?5','?6','?7','?8','?9','?10','?11','?12','?13','?14','?15');",nativeQuery = true)
List<Map<String,Object>> selectDeviceManagement(DeviceManagement deviceManagement);
/**
* 查询全部设备信息
*/
@Query(value = "SELECT * FROM device_management",nativeQuery = true)
List<Map<String,String>> equipment();
} }

View File

@ -0,0 +1,15 @@
package com.xkrs.dao;
import com.xkrs.model.entity.FireEvent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Component;
/**
* @Author: XinYi Song
* @Date: 2022/2/8 17:12
*/
@Component
public interface FireEventDao extends JpaRepository<FireEvent, Long>, JpaSpecificationExecutor<FireEvent> {
}

View File

@ -7,7 +7,7 @@ import javax.persistence.*;
* @Date: 2022/3/4 8:23 * @Date: 2022/3/4 8:23
*/ */
@Entity @Entity
@Table(name = "device_management") @Table(name = "DeviceManagement")
public class DeviceManagement { public class DeviceManagement {
/** /**
* 主键id * 主键id
@ -66,88 +66,76 @@ public class DeviceManagement {
*/ */
@Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
private String ownerCode; private String ownerCode;
/** /**
* 设备端口 * 添加方式
*/ */
@Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
private String updateTime; private String loginType;
/** /**
* 设备所属组织 * 登录名称
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private String loginName;
/**
* 登录密码
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private String loginPassword;
/**
* 主动注册代理端口
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private int registProxyPort;
/**
* 主动注册服务器编码
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private String registDeviceCode;
/**
* 通道描述
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private String memo;
/**
* 在线状态
*/ */
@Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
private int isOnline; private int isOnline;
// /** /**
// * 添加方式 * 光栅图
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private String loginType; private long mapId;
// /** /**
// * 登录名称 * 经度
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private String loginName; private String gpsX;
// /** /**
// * 登录密码 * 纬度
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private String loginPassword; private String gpsY;
// /** /**
// * 主动注册代理端口 * 设备所属子系统
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private int registProxyPort; private String subSystem;
// /** /**
// * 主动注册服务器编码 * 设备扩展属性
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private String registDeviceCode; private String devExt;
// /** /**
// * 通道描述 * 通道序号
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private String memo; private String channelSeq;
// /** /**
// * 在线状态 *通道名称
// */ */
// @Column(length = 32, columnDefinition = "varchar(32)") @Column(length = 32, columnDefinition = "varchar(32)")
// private int isOnline; private String channelName;
// /**
// * 光栅图
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private long mapId;
// /**
// * 经度
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String gpsX;
// /**
// * 纬度
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String gpsY;
// /**
// * 设备所属子系统
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String subSystem;
// /**
// * 设备扩展属性
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String devExt;
// /**
// * 通道序号
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String channelSeq;
// /**
// *通道名称
// */
// @Column(length = 32, columnDefinition = "varchar(32)")
// private String channelName;
/** /**
* 实时视频 * 实时视频
*/ */
@ -242,116 +230,52 @@ public class DeviceManagement {
this.ownerCode = ownerCode; this.ownerCode = ownerCode;
} }
// public String getLoginType() { public String getLoginType() {
// return loginType; return loginType;
// }
//
// public void setLoginType(String loginType) {
// this.loginType = loginType;
// }
//
// public String getLoginName() {
// return loginName;
// }
//
// public void setLoginName(String loginName) {
// this.loginName = loginName;
// }
//
// public String getLoginPassword() {
// return loginPassword;
// }
//
// public void setLoginPassword(String loginPassword) {
// this.loginPassword = loginPassword;
// }
//
// public int getRegistProxyPort() {
// return registProxyPort;
// }
//
// public void setRegistProxyPort(int registProxyPort) {
// this.registProxyPort = registProxyPort;
// }
//
// public String getRegistDeviceCode() {
// return registDeviceCode;
// }
//
// public void setRegistDeviceCode(String registDeviceCode) {
// this.registDeviceCode = registDeviceCode;
// }
//
// public String getMemo() {
// return memo;
// }
//
// public void setMemo(String memo) {
// this.memo = memo;
// }
//
// public int getIsOnline() {
// return isOnline;
// }
//
// public void setIsOnline(int isOnline) {
// this.isOnline = isOnline;
// }
//
// public long getMapId() {
// return mapId;
// }
//
// public void setMapId(long mapId) {
// this.mapId = mapId;
// }
//
// public String getGpsX() {
// return gpsX;
// }
//
// public void setGpsX(String gpsX) {
// this.gpsX = gpsX;
// }
//
// public String getGpsY() {
// return gpsY;
// }
//
// public void setGpsY(String gpsY) {
// this.gpsY = gpsY;
// }
//
// public String getSubSystem() {
// return subSystem;
// }
//
// public void setSubSystem(String subSystem) {
// this.subSystem = subSystem;
// }
//
// public String getDevExt() {
// return devExt;
// }
//
// public void setDevExt(String devExt) {
// this.devExt = devExt;
// }
public String getLiveVideo() {
return liveVideo;
} }
public void setLiveVideo(String liveVideo) { public void setLoginType(String loginType) {
this.liveVideo = liveVideo; this.loginType = loginType;
} }
public String getUpdateTime() { public String getLoginName() {
return updateTime; return loginName;
} }
public void setUpdateTime(String updateTime) { public void setLoginName(String loginName) {
this.updateTime = updateTime; this.loginName = loginName;
}
public String getLoginPassword() {
return loginPassword;
}
public void setLoginPassword(String loginPassword) {
this.loginPassword = loginPassword;
}
public int getRegistProxyPort() {
return registProxyPort;
}
public void setRegistProxyPort(int registProxyPort) {
this.registProxyPort = registProxyPort;
}
public String getRegistDeviceCode() {
return registDeviceCode;
}
public void setRegistDeviceCode(String registDeviceCode) {
this.registDeviceCode = registDeviceCode;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
} }
public int getIsOnline() { public int getIsOnline() {
@ -361,4 +285,44 @@ public class DeviceManagement {
public void setIsOnline(int isOnline) { public void setIsOnline(int isOnline) {
this.isOnline = isOnline; this.isOnline = isOnline;
} }
public long getMapId() {
return mapId;
}
public void setMapId(long mapId) {
this.mapId = mapId;
}
public String getGpsX() {
return gpsX;
}
public void setGpsX(String gpsX) {
this.gpsX = gpsX;
}
public String getGpsY() {
return gpsY;
}
public void setGpsY(String gpsY) {
this.gpsY = gpsY;
}
public String getSubSystem() {
return subSystem;
}
public void setSubSystem(String subSystem) {
this.subSystem = subSystem;
}
public String getDevExt() {
return devExt;
}
public void setDevExt(String devExt) {
this.devExt = devExt;
}
} }

View File

@ -0,0 +1,23 @@
package com.xkrs.model.entity;
import javax.persistence.*;
/**
* 大华推送的火情事件
*/
@Entity
@Table(name = "fire_event")
public class FireEvent {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_event_seq_gen")
@SequenceGenerator(name = "fire_event_seq_gen", sequenceName = "fire_event_id_seq", allocationSize = 1)
private Integer id;
@Column(length = 85, columnDefinition = "varchar(85)")
private String temp;
}

View File

@ -1,18 +0,0 @@
package com.xkrs.model.vo;
/**
* @Author: XinYi Song
* @Date: 2022/3/4 21:30
*/
public class ADD {
public String deviceName;
public String deviCevode;
public String deviceSn;
public int deviceCategory;
public int deviceType;
public String deviceManufacture;
public String deviceModel;
public String deviceLp;
public int devicePort;
public String ownerCode;
}

View File

@ -1,613 +0,0 @@
package com.xkrs.model.vo;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/3/4 21:31
*/
public class DA {
private Boolean success;
private DataDTO data;
private String code;
private String errMsg;
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public DataDTO getData() {
return data;
}
public void setData(DataDTO data) {
this.data = data;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public static class DataDTO {
private List<PageDataDTO> pageData;
private Integer currentPage;
private Integer totalPage;
private Integer pageSize;
private Integer totalRows;
public List<PageDataDTO> getPageData() {
return pageData;
}
public void setPageData(List<PageDataDTO> pageData) {
this.pageData = pageData;
}
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getTotalPage() {
return totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getTotalRows() {
return totalRows;
}
public void setTotalRows(Integer totalRows) {
this.totalRows = totalRows;
}
public static class PageDataDTO {
private String deviceName;
private String deviceCode;
private String deviceSn;
private Integer deviceCategory;
private Integer deviceType;
private String deviceManufacturer;
private String protocol;
private String deviceModel;
private String deviceIp;
private Integer devicePort;
private String ownerCode;
private String loginType;
private String loginName;
private String loginPassword;
private Boolean isPwdChange;
private String registServerCode;
private Integer isOnline;
private String onlineUpdateTime;
private Integer onlineUpdateVersion;
private String offlineReason;
private Integer isVirtual;
private String subSystem;
private DataDTO.PageDataDTO.DevExtDTO devExt;
private List<UnitsDTO> units;
private String updateTime;
private String deviceMac;
private Integer registProxyPort;
private String registDeviceCode;
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
public Integer getDeviceCategory() {
return deviceCategory;
}
public void setDeviceCategory(Integer deviceCategory) {
this.deviceCategory = deviceCategory;
}
public Integer getDeviceType() {
return deviceType;
}
public void setDeviceType(Integer deviceType) {
this.deviceType = deviceType;
}
public String getDeviceManufacturer() {
return deviceManufacturer;
}
public void setDeviceManufacturer(String deviceManufacturer) {
this.deviceManufacturer = deviceManufacturer;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public String getDeviceModel() {
return deviceModel;
}
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel;
}
public String getDeviceIp() {
return deviceIp;
}
public void setDeviceIp(String deviceIp) {
this.deviceIp = deviceIp;
}
public Integer getDevicePort() {
return devicePort;
}
public void setDevicePort(Integer devicePort) {
this.devicePort = devicePort;
}
public String getOwnerCode() {
return ownerCode;
}
public void setOwnerCode(String ownerCode) {
this.ownerCode = ownerCode;
}
public String getLoginType() {
return loginType;
}
public void setLoginType(String loginType) {
this.loginType = loginType;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getLoginPassword() {
return loginPassword;
}
public void setLoginPassword(String loginPassword) {
this.loginPassword = loginPassword;
}
public Boolean getPwdChange() {
return isPwdChange;
}
public void setPwdChange(Boolean pwdChange) {
isPwdChange = pwdChange;
}
public String getRegistServerCode() {
return registServerCode;
}
public void setRegistServerCode(String registServerCode) {
this.registServerCode = registServerCode;
}
public Integer getIsOnline() {
return isOnline;
}
public void setIsOnline(Integer isOnline) {
this.isOnline = isOnline;
}
public String getOnlineUpdateTime() {
return onlineUpdateTime;
}
public void setOnlineUpdateTime(String onlineUpdateTime) {
this.onlineUpdateTime = onlineUpdateTime;
}
public Integer getOnlineUpdateVersion() {
return onlineUpdateVersion;
}
public void setOnlineUpdateVersion(Integer onlineUpdateVersion) {
this.onlineUpdateVersion = onlineUpdateVersion;
}
public String getOfflineReason() {
return offlineReason;
}
public void setOfflineReason(String offlineReason) {
this.offlineReason = offlineReason;
}
public Integer getIsVirtual() {
return isVirtual;
}
public void setIsVirtual(Integer isVirtual) {
this.isVirtual = isVirtual;
}
public String getSubSystem() {
return subSystem;
}
public void setSubSystem(String subSystem) {
this.subSystem = subSystem;
}
public DevExtDTO getDevExt() {
return devExt;
}
public void setDevExt(DevExtDTO devExt) {
this.devExt = devExt;
}
public List<UnitsDTO> getUnits() {
return units;
}
public void setUnits(List<UnitsDTO> units) {
this.units = units;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getDeviceMac() {
return deviceMac;
}
public void setDeviceMac(String deviceMac) {
this.deviceMac = deviceMac;
}
public Integer getRegistProxyPort() {
return registProxyPort;
}
public void setRegistProxyPort(Integer registProxyPort) {
this.registProxyPort = registProxyPort;
}
public String getRegistDeviceCode() {
return registDeviceCode;
}
public void setRegistDeviceCode(String registDeviceCode) {
this.registDeviceCode = registDeviceCode;
}
public static class DevExtDTO {
private String pictureServerCode;
private String videoServerCode;
public String getPictureServerCode() {
return pictureServerCode;
}
public void setPictureServerCode(String pictureServerCode) {
this.pictureServerCode = pictureServerCode;
}
public String getVideoServerCode() {
return videoServerCode;
}
public void setVideoServerCode(String videoServerCode) {
this.videoServerCode = videoServerCode;
}
}
public static class UnitsDTO {
private Integer unitType;
private Integer unitSeq;
private DataDTO.PageDataDTO.UnitsDTO.UnitExtDTO unitExt;
private List<ChannelsDTO> channels;
public Integer getUnitType() {
return unitType;
}
public void setUnitType(Integer unitType) {
this.unitType = unitType;
}
public Integer getUnitSeq() {
return unitSeq;
}
public void setUnitSeq(Integer unitSeq) {
this.unitSeq = unitSeq;
}
public UnitExtDTO getUnitExt() {
return unitExt;
}
public void setUnitExt(UnitExtDTO unitExt) {
this.unitExt = unitExt;
}
public List<ChannelsDTO> getChannels() {
return channels;
}
public void setChannels(List<ChannelsDTO> channels) {
this.channels = channels;
}
public static class UnitExtDTO {
private String streamType;
private Integer zeroChnEncode;
private Integer assistStream;
public String getStreamType() {
return streamType;
}
public void setStreamType(String streamType) {
this.streamType = streamType;
}
public Integer getZeroChnEncode() {
return zeroChnEncode;
}
public void setZeroChnEncode(Integer zeroChnEncode) {
this.zeroChnEncode = zeroChnEncode;
}
public Integer getAssistStream() {
return assistStream;
}
public void setAssistStream(Integer assistStream) {
this.assistStream = assistStream;
}
}
public static class ChannelsDTO {
private String channelName;
private Integer channelSeq;
private String channelType;
private String cameraType;
private String capability;
private String ownerCode;
private String channelCode;
private Integer stat;
private Integer isOnline;
private String onlineUpdateTime;
private Integer onlineUpdateVersion;
private DataDTO.PageDataDTO.UnitsDTO.ChannelsDTO.ChExtDTO chExt;
private Integer isVirtual;
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public Integer getChannelSeq() {
return channelSeq;
}
public void setChannelSeq(Integer channelSeq) {
this.channelSeq = channelSeq;
}
public String getChannelType() {
return channelType;
}
public void setChannelType(String channelType) {
this.channelType = channelType;
}
public String getCameraType() {
return cameraType;
}
public void setCameraType(String cameraType) {
this.cameraType = cameraType;
}
public String getCapability() {
return capability;
}
public void setCapability(String capability) {
this.capability = capability;
}
public String getOwnerCode() {
return ownerCode;
}
public void setOwnerCode(String ownerCode) {
this.ownerCode = ownerCode;
}
public String getChannelCode() {
return channelCode;
}
public void setChannelCode(String channelCode) {
this.channelCode = channelCode;
}
public Integer getStat() {
return stat;
}
public void setStat(Integer stat) {
this.stat = stat;
}
public Integer getIsOnline() {
return isOnline;
}
public void setIsOnline(Integer isOnline) {
this.isOnline = isOnline;
}
public String getOnlineUpdateTime() {
return onlineUpdateTime;
}
public void setOnlineUpdateTime(String onlineUpdateTime) {
this.onlineUpdateTime = onlineUpdateTime;
}
public Integer getOnlineUpdateVersion() {
return onlineUpdateVersion;
}
public void setOnlineUpdateVersion(Integer onlineUpdateVersion) {
this.onlineUpdateVersion = onlineUpdateVersion;
}
public ChExtDTO getChExt() {
return chExt;
}
public void setChExt(ChExtDTO chExt) {
this.chExt = chExt;
}
public Integer getIsVirtual() {
return isVirtual;
}
public void setIsVirtual(Integer isVirtual) {
this.isVirtual = isVirtual;
}
public static class ChExtDTO {
}
}
}
}
}
}

View File

@ -2,7 +2,6 @@ package com.xkrs.service;
import com.xkrs.model.entity.CameraInformation; import com.xkrs.model.entity.CameraInformation;
import com.xkrs.model.entity.DeviceManagement; import com.xkrs.model.entity.DeviceManagement;
import com.xkrs.model.vo.ADD;
import java.util.List; import java.util.List;
@ -26,18 +25,9 @@ public interface CameraService {
* @return * @return
*/ */
List<DeviceManagement> SelectDevice(); List<DeviceManagement> SelectDevice();
/**
* 查询摄像头信息
* @return
*/
String Videotape();
/**
*
*/
String Selectequipment();
/** /**
* 添加设备分页信息 * 添加设备分页信息
*/ */
String InsertPaging(List<DeviceManagement> para); boolean InsertPaging(DeviceManagement para);
} }

View File

@ -0,0 +1,11 @@
package com.xkrs.service;
/**
* @Author: XinYi Song
* @Date: 2022/2/11 8:51
*/
public interface FireEventService {
String selectFireEventList();
}

View File

@ -1,7 +1,5 @@
package com.xkrs.service; package com.xkrs.service;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
* @Author: XinYi Song * @Author: XinYi Song
* @Date: 2022/2/11 8:51 * @Date: 2022/2/11 8:51
@ -10,6 +8,7 @@ public interface FireService {
/** /**
* 根据设备编码获取火情信息 * 根据设备编码获取火情信息
*
* @param code * @param code
* @return * @return
*/ */
@ -17,6 +16,7 @@ public interface FireService {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -26,12 +26,14 @@ public interface FireService {
/** /**
* 查询最新三百条火情信息 * 查询最新三百条火情信息
*
* @return * @return
*/ */
String findThreeHundredData(); String findThreeHundredData();
/** /**
* 修改火点状态 * 修改火点状态
*
* @param alarmCode * @param alarmCode
* @return * @return
*/ */

View File

@ -1,25 +1,16 @@
package com.xkrs.service.impl; package com.xkrs.service.impl;
import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.CameraDao; import com.xkrs.dao.CameraDao;
import com.xkrs.dao.DeviceManagementDao; import com.xkrs.dao.DeviceManagementDao;
import com.xkrs.dao.FireDao; import com.xkrs.dao.FireDao;
import com.xkrs.model.entity.CameraInformation; import com.xkrs.model.entity.CameraInformation;
import com.xkrs.model.entity.DeviceManagement; import com.xkrs.model.entity.DeviceManagement;
import com.xkrs.model.vo.ADD;
import com.xkrs.service.CameraService; import com.xkrs.service.CameraService;
import com.xkrs.util.Query; import com.xkrs.util.Query;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/** /**
* @Author: XinYi Song * @Author: XinYi Song
@ -33,8 +24,6 @@ public class CameraServiceImpl implements CameraService {
@Resource @Resource
private DeviceManagementDao deviceManagementDao; private DeviceManagementDao deviceManagementDao;
Locale locale = LocaleContextHolder.getLocale();
@Override @Override
public List<CameraInformation> SelectCameraAll() { public List<CameraInformation> SelectCameraAll() {
List<CameraInformation> cameraInformations =cameraDao.findAll(); List<CameraInformation> cameraInformations =cameraDao.findAll();
@ -50,10 +39,13 @@ public class CameraServiceImpl implements CameraService {
try { try {
cameraDao.save(cameraInformation); cameraDao.save(cameraInformation);
return true; return true;
} catch (Exception e) { }
catch (Exception e){
return false; return false;
} }
} }
@Override @Override
@ -66,28 +58,15 @@ public class CameraServiceImpl implements CameraService {
} }
@Override @Override
public String Videotape() { public boolean InsertPaging(DeviceManagement para)
List<Map<String,String>> stringObjectMap = deviceManagementDao.Videotape(); {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,stringObjectMap,locale);
}
@Override
public String Selectequipment() {
List<Map<String,String>> stringObjectMap = deviceManagementDao.equipment();
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,stringObjectMap,locale);
}
@Override
public String InsertPaging(List<DeviceManagement> para) {
try { try {
deviceManagementDao.selectDeviceManagement(para);
return true;
}
catch (Exception e){
return false;
DeviceManagement deviceManagement = new DeviceManagement();
return "成功添加!";
} catch (Exception e) {
return e.getMessage();
} }
} }
} }

View File

@ -0,0 +1,30 @@
package com.xkrs.service.impl;
import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.FireEventDao;
import com.xkrs.model.entity.FireEvent;
import com.xkrs.service.FireEventService;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Locale;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@Service
public class FireEventServiceImpl implements FireEventService {
@Resource
private FireEventDao fireEventDao;
private Locale locale = LocaleContextHolder.getLocale();
@Override
public String selectFireEventList() {
List<FireEvent> fireEventList = fireEventDao.findAll();
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, fireEventList, locale);
}
}

View File

@ -34,9 +34,9 @@ public class FireServerImpl implements FireService {
Locale locale = LocaleContextHolder.getLocale(); Locale locale = LocaleContextHolder.getLocale();
/** /**
* 根据设备编码获取火情的信息 * 根据设备编码获取火情的信息
*
* @param code * @param code
* @return * @return
*/ */
@ -52,6 +52,7 @@ public class FireServerImpl implements FireService {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -69,6 +70,7 @@ public class FireServerImpl implements FireService {
/** /**
* 查询最新300条火情信息 * 查询最新300条火情信息
*
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@ -84,6 +86,7 @@ public class FireServerImpl implements FireService {
/** /**
* 修改火点状态 * 修改火点状态
*
* @param alarmCode * @param alarmCode
* @return * @return
*/ */

View File

@ -14,16 +14,15 @@ import java.util.Map;
*/ */
public class ManagementUtil { public class ManagementUtil {
public static JsonNode getManagement() { public static JsonNode getManagement() {
String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.0.0/device?deviceCode=1001339"; String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.0.0/device?deviceCode=100001";
Map<String, String> map = new HashMap<>(3); Map<String, String> map = new HashMap<>(3);
JsonNode jsonNode = RequestUtil.doGetJsonNode(url, map); JsonNode jsonNode = RequestUtil.doGetJsonNode(url, map);
return jsonNode; return jsonNode;
} }
//https://{{host}}/evo-apigw/evo-brm/{{version}}/device/1001339
public static String getPaging(String para) { public static String getPaging(String para) {
String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.2.0/devic?deviceCode="+para; String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.2.0/device/subsystem/page";
String jsonNode = RequestUtil.getPost(url); String jsonNode = RequestUtil.doPostJson(url, para);
return jsonNode; return jsonNode;
} }

View File

@ -124,48 +124,6 @@ public class RequestUtil {
return result; return result;
} }
/**
* get设备详细信息查询
* @param url
* @return String
*/
public static String getPost(String url) {
// 创建Httpclient对象
CloseableHttpClient httpclient = HttpClients.createDefault();
String resultString = "";
CloseableHttpResponse response = null;
try {
URI uri = new URI(url);
// 创建http GET请求
HttpGet httpGet = new HttpGet(uri);
// 执行请求
response = httpclient.execute(httpGet);
// 判断返回状态是否为200
if (response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
ObjectMapper objectMapper = new ObjectMapper();
//使用ObjectMapper对象对 User对象进行转换
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (response != null) {
response.close();
}
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
/** /**
* 带参数的get请求 * 带参数的get请求
* @param url * @param url