Compare commits

..

7 Commits

Author SHA1 Message Date
7812cd3a73 Default Changelist 2022-03-05 18:03:09 +08:00
af65dc23f5 接收火情事件 2022-03-05 17:59:05 +08:00
b5de1fc8f0 Default Changelist 2022-03-05 17:56:39 +08:00
acdaf4c3a4 Merge remote-tracking branch 'origin/master' 2022-03-05 17:56:26 +08:00
50cefb8ef0 添加火情事件模块 2022-03-05 17:07:34 +08:00
e727446553 Default Changelist 2022-03-05 14:15:10 +08:00
8f889ef4e8 Default Changelist 2022-03-05 14:11:13 +08:00
21 changed files with 1267 additions and 357 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,6 +201,11 @@
<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,12 +1,21 @@
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
@ -15,6 +24,7 @@ import org.springframework.jms.annotation.EnableJms;
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,9 +1,12 @@
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;
@ -11,6 +14,8 @@ 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;
/** /**
@ -28,6 +33,7 @@ public class CameraController {
@Resource @Resource
private DeviceManagementDao deviceManagementDao; private DeviceManagementDao deviceManagementDao;
@GetMapping("/getCameraInformation") @GetMapping("/getCameraInformation")
public List<CameraInformation> getCameraInformation(){ public List<CameraInformation> getCameraInformation(){
@ -44,12 +50,85 @@ public class CameraController {
return false; return false;
} }
} }
@GetMapping("/SelectDeviceManagement") /**
public List<DeviceManagement> SelectDeviceManagement() * 返回全部信息
* @param
* @return
*/
@GetMapping("/findEquipment1")
public String Selectequipment(){
try
{ {
return cameraService.SelectDevice(); 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")
public String SelectDeviceManagement()
{
File file = new File("C:\\Users\\HP\\Desktop\\摄像头设备信息.txt");
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,11 +3,15 @@ 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;
@ -36,7 +40,6 @@ public class FireController {
/** /**
* 根据设备编号获取火情信息 * 根据设备编号获取火情信息
*
* @param code * @param code
* @return * @return
*/ */
@ -47,7 +50,6 @@ public class FireController {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -60,7 +62,6 @@ public class FireController {
/** /**
* 查询最新的300条火情信息 * 查询最新的300条火情信息
*
* @return * @return
*/ */
@GetMapping("/findThreeHundredData") @GetMapping("/findThreeHundredData")
@ -70,7 +71,6 @@ public class FireController {
/** /**
* 查询一个月中每一天各个街道的火情数量 * 查询一个月中每一天各个街道的火情数量
*
* @param beginTime * @param beginTime
* @param endTime * @param endTime
* @return * @return
@ -86,7 +86,6 @@ public class FireController {
/** /**
* 查询一年中每个月的各个街道的火情数量 * 查询一年中每个月的各个街道的火情数量
*
* @param beginTime * @param beginTime
* @param endTime * @param endTime
* @return * @return
@ -102,7 +101,6 @@ public class FireController {
/** /**
* 修改火点状态 * 修改火点状态
*
* @param map * @param map
* @return * @return
*/ */
@ -115,7 +113,6 @@ public class FireController {
/** /**
* 查询已处理和未处理的火点的数量 * 查询已处理和未处理的火点的数量
*
* @param street * @param street
* @param month * @param month
* @return * @return
@ -131,5 +128,4 @@ 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,31 +4,38 @@ 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.xkrs.service.FireEventService; import com.fasterxml.jackson.databind.JsonNode;
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 javax.annotation.Resource; import java.io.IOException;
import java.util.Locale;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/** /**
* @Author: XinYi Song * ./start.sh
* @Date: 2022/2/11 9:03 * sudo tail -f nohup.out
* /home/sxy/server/SmartUrbanRural
*/ */
@RestController @RestController
public class FireEventController { public class FireEventController {
@Resource Locale locale = LocaleContextHolder.getLocale();
private FireEventService fireEventService;
/** /**
* 订阅火情事件 * 订阅火情事件
*/ */
@GetMapping("/subscribeFireEvent") @GetMapping("/subscribeFireEvent")
public void subscribeFireEvent() { public String 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";
@ -43,21 +50,41 @@ 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 Object fireEvent) { public void receiveFireEvent(@RequestBody String message) throws IOException {
try { JsonNode jsonNode = new ObjectMapper().readTree(message);
System.out.println("----接收火情事件----{}------" + fireEvent.toString());
} catch (Exception e) { String category = jsonNode.get("category").asText();
e.printStackTrace(); String method = jsonNode.get("method").asText();
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;
}
} }
/** /**
@ -65,7 +92,7 @@ public class FireEventController {
*/ */
@GetMapping("/selectFireEvent") @GetMapping("/selectFireEvent")
public String selectFireEvent() { public String selectFireEvent() {
return fireEventService.selectFireEventList(); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "selectFireEvent", locale);
} }
} }

View File

@ -0,0 +1,127 @@
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,10 +20,7 @@ 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.HashMap; import java.util.*;
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;
@ -134,35 +131,39 @@ public class TestController {
* @return * @return
*/ */
@GetMapping("/getPaging") @GetMapping("/getPaging")
public boolean getPaging( String para) { public String 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);
ObjectMapper objectMapper = new ObjectMapper(); // List<Map<String, String>> listObjectFir = (List<Map<String, String>>) JSONArray.parse(forecastWeather);
JsonNode jsonNode = null; // ObjectMapper objectMapper = new ObjectMapper();
try { // JsonNode jsonNode = null;
jsonNode = objectMapper.readTree(forecastWeather); // try {
} catch (JsonProcessingException e) { // jsonNode = objectMapper.readTree(forecastWeather);
e.printStackTrace(); // } catch (JsonProcessingException e) {
} // e.printStackTrace();
String method = jsonNode.get("method").asText(); // }
if("vms.alarm.msg".equals(method)){ // List<DeviceManagement> item= new ArrayList<>();
JsonNode info = jsonNode.get("info"); // String method = jsonNode.get("method").asText();
DeviceManagement fire = new DeviceManagement(); // if("vms.alarm.msg".equals(method)){
fire.setDeviceName(info.get("deviceName").asText()); // JsonNode info = jsonNode.get("info");
fire.setDeviceCode(info.get("deviceCode").asText()); // DeviceManagement fire = new DeviceManagement();
fire.setDeviceSn(info.get("deviceSn").asText()); // fire.setDeviceName(info.get("deviceName").asText());
fire.setDeviceCategory(Integer.valueOf(info.get("deviceCategory").asText())); // fire.setDeviceCode(info.get("deviceCode").asText());
fire.setDeviceType(Integer.valueOf(info.get("deviceType").asText())); // fire.setDeviceSn(info.get("deviceSn").asText());
fire.setDeviceManufacturer(info.get("deviceManufacturer").asText()); // fire.setDeviceCategory(Integer.valueOf(info.get("deviceCategory").asText()));
fire.setDeviceModel(info.get("deviceModel").asText()); // fire.setDeviceType(Integer.valueOf(info.get("deviceType").asText()));
fire.setDeviceIp(info.get("deviceIp").asText()); // fire.setDeviceManufacturer(info.get("deviceManufacturer").asText());
fire.setDevicePort(Integer.valueOf(info.get("devicePort").asText())); // fire.setDeviceModel(info.get("deviceModel").asText());
fire.setOwnerCode(info.get("ownerCode").asText()); // fire.setDeviceIp(info.get("deviceIp").asText());
//fire.setOwnerOrgName(Integer.valueOf(info.get("ownerOrgName").asText())); // fire.setDevicePort(Integer.valueOf(info.get("devicePort").asText()));
fire.setIsOnline(Integer.valueOf(info.get("isOnline").asText())); // fire.setOwnerCode(info.get("ownerCode").asText());
fire.setSubSystem(info.get("subSystem").asText()); // //fire.setOwnerOrgName(Integer.valueOf(info.get("ownerOrgName").asText()));
fire.setDevExt(info.get("devExt").asText()); //// fire.setIsOnline(Integer.valueOf(info.get("isOnline").asText()));
} //// fire.setSubSystem(info.get("subSystem").asText());
return true; //// fire.setDevExt(info.get("devExt").asText());
// item.add(fire);
// }
return forecastWeather;
} }
} }

View File

@ -2,10 +2,13 @@ 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;
/** /**
@ -14,11 +17,16 @@ import java.util.Map;
*/ */
public interface DeviceManagementDao extends JpaRepository<DeviceManagement,Long> { public interface DeviceManagementDao extends JpaRepository<DeviceManagement,Long> {
/**
* 添加设备分页信息
*/
@Query(value = "Insert device_management('','','','','','','','','','','','','','','','','') " +
"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 device_code,live_video FROM device_management",nativeQuery = true)
List<Map<String,String>> Videotape();
/**
* 查询全部设备信息
*/
@Query(value = "SELECT * FROM device_management",nativeQuery = true)
List<Map<String,String>> equipment();
} }

View File

@ -1,15 +0,0 @@
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 = "DeviceManagement") @Table(name = "device_management")
public class DeviceManagement { public class DeviceManagement {
/** /**
* 主键id * 主键id
@ -66,76 +66,88 @@ 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 loginType; private String updateTime;
/** /**
* 登录名称 * 设备所属组织
*/
@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 long mapId; // private String loginType;
/** // /**
* 经度 // * 登录名称
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String gpsX; // private String loginName;
/** // /**
* 纬度 // * 登录密码
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String gpsY; // private String loginPassword;
/** // /**
* 设备所属子系统 // * 主动注册代理端口
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String subSystem; // private int registProxyPort;
/** // /**
* 设备扩展属性 // * 主动注册服务器编码
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String devExt; // private String registDeviceCode;
/** // /**
* 通道序号 // * 通道描述
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String channelSeq; // private String memo;
/** // /**
*通道名称 // * 在线状态
*/ // */
@Column(length = 32, columnDefinition = "varchar(32)") // @Column(length = 32, columnDefinition = "varchar(32)")
private String channelName; // private int isOnline;
// /**
// * 光栅图
// */
// @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;
/** /**
* 实时视频 * 实时视频
*/ */
@ -230,52 +242,116 @@ 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 setLoginType(String loginType) { public void setLiveVideo(String liveVideo) {
this.loginType = loginType; this.liveVideo = liveVideo;
} }
public String getLoginName() { public String getUpdateTime() {
return loginName; return updateTime;
} }
public void setLoginName(String loginName) { public void setUpdateTime(String updateTime) {
this.loginName = loginName; this.updateTime = updateTime;
}
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() {
@ -285,44 +361,4 @@ 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

@ -1,23 +0,0 @@
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

@ -0,0 +1,18 @@
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

@ -0,0 +1,613 @@
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,6 +2,7 @@ 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;
@ -25,9 +26,18 @@ public interface CameraService {
* @return * @return
*/ */
List<DeviceManagement> SelectDevice(); List<DeviceManagement> SelectDevice();
/**
* 查询摄像头信息
* @return
*/
String Videotape();
/**
*
*/
String Selectequipment();
/** /**
* 添加设备分页信息 * 添加设备分页信息
*/ */
boolean InsertPaging(DeviceManagement para); String InsertPaging(List<DeviceManagement> para);
} }

View File

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

View File

@ -1,5 +1,7 @@
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
@ -8,7 +10,6 @@ public interface FireService {
/** /**
* 根据设备编码获取火情信息 * 根据设备编码获取火情信息
*
* @param code * @param code
* @return * @return
*/ */
@ -16,7 +17,6 @@ public interface FireService {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -26,14 +26,12 @@ public interface FireService {
/** /**
* 查询最新三百条火情信息 * 查询最新三百条火情信息
*
* @return * @return
*/ */
String findThreeHundredData(); String findThreeHundredData();
/** /**
* 修改火点状态 * 修改火点状态
*
* @param alarmCode * @param alarmCode
* @return * @return
*/ */

View File

@ -1,16 +1,25 @@
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
@ -24,6 +33,8 @@ 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();
@ -39,13 +50,10 @@ 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
@ -58,15 +66,28 @@ public class CameraServiceImpl implements CameraService {
} }
@Override @Override
public boolean InsertPaging(DeviceManagement para) public String Videotape() {
{ List<Map<String,String>> stringObjectMap = deviceManagementDao.Videotape();
try { return outputEncapsulationObject(PromptMessageEnum.SUCCESS,stringObjectMap,locale);
deviceManagementDao.selectDeviceManagement(para);
return true;
}
catch (Exception e){
return false; }
@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 {
DeviceManagement deviceManagement = new DeviceManagement();
return "成功添加!";
} catch (Exception e) {
return e.getMessage();
} }
} }
} }

View File

@ -1,30 +0,0 @@
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,7 +52,6 @@ public class FireServerImpl implements FireService {
/** /**
* 根据设备编码和时间段查询火情信息 * 根据设备编码和时间段查询火情信息
*
* @param code * @param code
* @param startTime * @param startTime
* @param endTime * @param endTime
@ -70,7 +69,6 @@ public class FireServerImpl implements FireService {
/** /**
* 查询最新300条火情信息 * 查询最新300条火情信息
*
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator",unless="#result == null") @Cacheable(keyGenerator = "keyGenerator",unless="#result == null")
@ -86,7 +84,6 @@ public class FireServerImpl implements FireService {
/** /**
* 修改火点状态 * 修改火点状态
*
* @param alarmCode * @param alarmCode
* @return * @return
*/ */

View File

@ -14,15 +14,16 @@ 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=100001"; String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.0.0/device?deviceCode=1001339";
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/device/subsystem/page"; String url = "https://111.53.13.180:4433/evo-apigw/evo-brm/1.2.0/devic?deviceCode="+para;
String jsonNode = RequestUtil.doPostJson(url, para); String jsonNode = RequestUtil.getPost(url);
return jsonNode; return jsonNode;
} }

View File

@ -124,6 +124,48 @@ 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