|
|
@ -68,6 +68,8 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
|
|
|
|
List<String> records = null;
|
|
|
|
List<String> records = null;
|
|
|
|
// 获取id
|
|
|
|
// 获取id
|
|
|
|
String body = HttpRequest.post(specificWarn).header("Authorization", "Basic " + token).body(bodyJson).execute().body();
|
|
|
|
String body = HttpRequest.post(specificWarn).header("Authorization", "Basic " + token).body(bodyJson).execute().body();
|
|
|
|
|
|
|
|
log.info("===========================================");
|
|
|
|
|
|
|
|
log.info("++++++++++++++++" + body + "++++++++++++++");
|
|
|
|
JSONObject json = JSONObject.parse(body);
|
|
|
|
JSONObject json = JSONObject.parse(body);
|
|
|
|
Object response = json.get("response");
|
|
|
|
Object response = json.get("response");
|
|
|
|
if (BeanUtil.isNotEmpty(response)) {
|
|
|
|
if (BeanUtil.isNotEmpty(response)) {
|
|
|
@ -101,19 +103,30 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
|
|
|
|
Object response = json.get("response");
|
|
|
|
Object response = json.get("response");
|
|
|
|
if (BeanUtil.isNotEmpty(response)) {
|
|
|
|
if (BeanUtil.isNotEmpty(response)) {
|
|
|
|
String recordsStr = JSONUtil.toJsonStr(response);
|
|
|
|
String recordsStr = JSONUtil.toJsonStr(response);
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(recordsStr)) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
records = JSONUtil.toBean(recordsStr, Alarm.class);
|
|
|
|
records = JSONUtil.toBean(recordsStr, Alarm.class);
|
|
|
|
|
|
|
|
if (records == null) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
JSONObject recordsJson = JSONObject.parse(recordsStr);
|
|
|
|
JSONObject recordsJson = JSONObject.parse(recordsStr);
|
|
|
|
|
|
|
|
if (BeanUtil.isEmpty(recordsJson)) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
Object bjdhsj = recordsJson.get("bjdhsj");
|
|
|
|
Object bjdhsj = recordsJson.get("bjdhsj");
|
|
|
|
String bjdhsjStr = JSONUtil.toJsonStr(bjdhsj);
|
|
|
|
if (BeanUtil.isNotEmpty(bjdhsj)) {
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").withZone(ZoneId.systemDefault());
|
|
|
|
String bjdhsjStr = JSONUtil.toJsonStr(bjdhsj);
|
|
|
|
LocalDateTime emergencyEventTime = LocalDateTime.parse(bjdhsjStr, formatter);
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").withZone(ZoneId.systemDefault());
|
|
|
|
records.setEmergencyEventTime(emergencyEventTime);
|
|
|
|
LocalDateTime emergencyEventTime = LocalDateTime.parse(bjdhsjStr, formatter);
|
|
|
|
records.setCreateTime(LocalDateTime.now());
|
|
|
|
records.setEmergencyEventTime(emergencyEventTime);
|
|
|
|
records.setUpdateTime(LocalDateTime.now());
|
|
|
|
records.setCreateTime(LocalDateTime.now());
|
|
|
|
records.setDelFlag(0);
|
|
|
|
records.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
records.setDelFlag(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
log.info("系统内部异常,请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return records;
|
|
|
|
return records;
|
|
|
|
}
|
|
|
|
}
|
|
|
|