|
@@ -245,6 +245,9 @@ public class GeoHazardMonitorTokenController {
|
|
|
@PostMapping("/api/alarm")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String alarm(@RequestBody ParameterVo parameterVo, HttpServletRequest request) throws Exception {
|
|
|
+ long begin = System.currentTimeMillis();
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
+ log.info("报警信息数据传输开始时间: " + simpleDateFormat.format(new Date(begin)));
|
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameter:{}", parameterVo);
|
|
@@ -415,6 +418,9 @@ public class GeoHazardMonitorTokenController {
|
|
|
msgAlarmFrequencyService.save(msgAlarmVice);
|
|
|
}
|
|
|
AjaxResults1 = new AjaxResults(1, "ok");
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ log.info("报警信息数据传输结束时间: " + simpleDateFormat.format(new Date(end)));
|
|
|
+ log.info("报警信息数据传输请求用时时间:" + (end - begin) + "毫秒");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
} else {
|
|
|
AjaxResults1 = new AjaxResults(2, "token验证失败");
|
|
@@ -509,7 +515,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
@Transactional
|
|
|
public String heartbeat(@RequestBody ParameterVo parameterVo, HttpServletRequest request) throws Exception {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
log.info("接受心跳时间: " + sdf.format(new Date(begin)));
|
|
|
int distance = 0;
|
|
|
boolean type = true;
|
|
@@ -2317,6 +2323,9 @@ public class GeoHazardMonitorTokenController {
|
|
|
*/
|
|
|
@PostMapping("/api/preAlarm")
|
|
|
public String preAlarm(@RequestBody ParameterVo parameterVo, HttpServletRequest request) {
|
|
|
+ long begin = System.currentTimeMillis();
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
+ log.info("预警信息传输开始时间: " + simpleDateFormat.format(new Date(begin)));
|
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
|
log.info("token:{}", token);
|
|
|
log.info("parameterVo:{}", parameterVo);
|
|
@@ -2383,6 +2392,9 @@ public class GeoHazardMonitorTokenController {
|
|
|
preAlarm.setCreatedTime(new Date());
|
|
|
if (preAlarmService.save(preAlarm)) {
|
|
|
AjaxResults1 = new AjaxResults(1, "ok");
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ log.info("预警信息传输结束时间: " + simpleDateFormat.format(new Date(end)));
|
|
|
+ log.info("预警信息传输请求用时时间:" + (end - begin) + "毫秒");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
|
|
|
} else {
|
|
|
AjaxResults1 = new AjaxResults(0, "新增失败");
|