# Conflicts:
#	src/main/java/com/xkrs/model/entity/DeviceManagement.java
This commit is contained in:
XinYi Song 2022-03-04 19:10:38 +08:00
commit 53b6898daa

View File

@ -136,46 +136,33 @@ public class TestController {
@GetMapping("/getPaging") @GetMapping("/getPaging")
public boolean 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 = objectMapper.readTree(message); JsonNode jsonNode = null;
try {
jsonNode = objectMapper.readTree(forecastWeather);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
String method = jsonNode.get("method").asText(); String method = jsonNode.get("method").asText();
if("vms.alarm.msg".equals(method)){ if("vms.alarm.msg".equals(method)){
JsonNode info = jsonNode.get("info"); JsonNode info = jsonNode.get("info");
Fire fire = new Fire(); DeviceManagement fire = new DeviceManagement();
fire.setDeviceName(info.get("deviceName").asText());
fire.setDeviceCode(info.get("deviceCode").asText()); fire.setDeviceCode(info.get("deviceCode").asText());
fire.setChannelSeq(info.get("channelSeq").asText()); fire.setDeviceSn(info.get("deviceSn").asText());
fire.setUnitType(info.get("unitType").asText()); fire.setDeviceCategory(Integer.valueOf(info.get("deviceCategory").asText()));
fire.setNodeType(info.get("nodeType").asText()); fire.setDeviceType(Integer.valueOf(info.get("deviceType").asText()));
fire.setNodeCode(info.get("nodeCode").asText()); fire.setDeviceManufacturer(info.get("deviceManufacturer").asText());
String alarmCode = info.get("alarmCode").asText(); fire.setDeviceModel(info.get("deviceModel").asText());
fire.setAlarmCode(alarmCode); fire.setDeviceIp(info.get("deviceIp").asText());
fire.setAlarmStat(info.get("alarmStat").asText()); fire.setDevicePort(Integer.valueOf(info.get("devicePort").asText()));
fire.setAlarmType(info.get("alarmType").asText()); fire.setOwnerCode(info.get("ownerCode").asText());
fire.setAlarmGrade(info.get("alarmGrade").asText()); //fire.setOwnerOrgName(Integer.valueOf(info.get("ownerOrgName").asText()));
fire.setAlarmPicture(info.get("alarmPicture").asText()); fire.setIsOnline(Integer.valueOf(info.get("isOnline").asText()));
String modifyTime = DateTimeUtil.timeMillisToString(Long.parseLong(info.get("alarmDate").asText())); fire.setSubSystem(info.get("subSystem").asText());
fire.setAlarmDate(modifyTime); fire.setDevExt(info.get("devExt").asText());
fire.setAlarmSourceName(info.get("alarmSourceName").asText());
fire.setAlarmLongitude(info.get("gpsX").asText());
fire.setAlarmLatitude(info.get("gpsY").asText());
fire.setAltitude(info.get("altitude").asText());
fire.setFireDistance(info.get("fireDistance").asText());
fire.setFireId(info.get("fsid").asText());
fire.setFireState("0");
} }
*//* for (int i=0;i<listObjectFir.size();i++)
{
DeviceManagement deviceManagement=new DeviceManagement();
deviceManagement.setDeviceName(listObjectFir.size();
}*//*
*//* for (Map<String,<String> mapList : listObjectFir) {
for (Map.Entry entry : mapList.entrySet()) {
System.out.println(entry.getKey() + " " + entry.getValue());
}
}*/
return true; return true;
} }
} }