|
@@ -19,6 +19,7 @@ import com.ozs.entity.BaseVehicleTerminal;
|
|
|
import com.ozs.entity.MsgAlarm;
|
|
|
import com.ozs.entity.MsgAlarmExt;
|
|
|
import com.ozs.entity.MsgAlarmFrequency;
|
|
|
+import com.ozs.entity.MsgHearbeatAlarmMessage;
|
|
|
import com.ozs.entity.SvcAddress;
|
|
|
import com.ozs.entity.SkynetHeartbeatLog;
|
|
|
import com.ozs.entity.TerminalIgnoreAlarm;
|
|
@@ -43,6 +44,7 @@ import com.ozs.entity.vo.SkynetHeartbeatVo;
|
|
|
import com.ozs.entity.vo.TerminalIgnoreVo;
|
|
|
import com.ozs.framework.config.ServerConfig;
|
|
|
import com.ozs.mapper.AlarmHeartbeatLogMapper;
|
|
|
+import com.ozs.mapper.MsgHearbeatAlarmMessageMapper;
|
|
|
import com.ozs.mapper.SkynetHeartbeatLogMapper;
|
|
|
import com.ozs.service.BaseCameraManagementService;
|
|
|
import com.ozs.service.BaseRailwayManagementService;
|
|
@@ -140,6 +142,8 @@ public class GeoHazardMonitorTokenController {
|
|
|
private SkynetHeartbeatLogMapper synetHeartbeatLogMapper;
|
|
|
@Resource
|
|
|
private AlarmHeartbeatLogMapper alarmHeartbeatLogMapper;
|
|
|
+ @Resource
|
|
|
+ private MsgHearbeatAlarmMessageMapper msgHearbeatAlarmMessageMapper;
|
|
|
@Value("${base.env}")
|
|
|
private String env;
|
|
|
|
|
@@ -155,7 +159,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
LambdaQueryWrapper<SvcAddress> lw = new LambdaQueryWrapper<SvcAddress>();
|
|
|
if (!ObjectUtils.isEmpty(svcAddress.getClientId())) {
|
|
|
lw.eq(SvcAddress::getClientId, svcAddress.getClientId());
|
|
|
- lw.eq(SvcAddress::getEnv,env);
|
|
|
+ lw.eq(SvcAddress::getEnv, env);
|
|
|
} else {
|
|
|
jsonObject.put("resultCode", 0);
|
|
|
jsonObject.put("message", "失败");
|
|
@@ -290,7 +294,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
if (!ObjectUtils.isEmpty(reqMsgAlarmVo.getAlarmMile())) {
|
|
|
wrapper.le(BaseCameraManagement::getBeginMile, reqMsgAlarmVo.getAlarmMile());
|
|
|
wrapper.ge(BaseCameraManagement::getEndMile, reqMsgAlarmVo.getAlarmMile());
|
|
|
- wrapper.eq(BaseCameraManagement::getRailwayCode,reqMsgAlarmVo.getAlarmRailway());
|
|
|
+ wrapper.eq(BaseCameraManagement::getRailwayCode, reqMsgAlarmVo.getAlarmRailway());
|
|
|
wrapper.eq(BaseCameraManagement::getLineDir, reqMsgAlarmVo.getLineDir());
|
|
|
}
|
|
|
List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(wrapper);
|
|
@@ -625,7 +629,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
queryWrapper.ge(MsgAlarm::getAlarmMile, heartbeatVo.getCurrentMile());
|
|
|
queryWrapper.le(MsgAlarm::getAlarmMile, (heartbeatVo.getCurrentMile() + 10000));
|
|
|
queryWrapper.eq(MsgAlarm::getLineDir, heartbeatVo.getLineDir());
|
|
|
- queryWrapper.eq(MsgAlarm::getRailwayCode,heartbeatVo.getRailwayCode());
|
|
|
+ queryWrapper.eq(MsgAlarm::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
queryWrapper.orderByAsc(MsgAlarm::getAlarmMile);
|
|
|
List<MsgAlarm> list = msgAlarmService.list(queryWrapper);
|
|
|
//有报警信息的时候
|
|
@@ -676,6 +680,11 @@ public class GeoHazardMonitorTokenController {
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
}
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
+ MsgHearbeatAlarmMessage msgHearbeatAlarmMessage = new MsgHearbeatAlarmMessage();
|
|
|
+ msgHearbeatAlarmMessage.setAlarmId(list.get(i).getAlarmId());
|
|
|
+ msgHearbeatAlarmMessage.setVehicleCode(heartbeatVo.getVehicleCode());
|
|
|
+ msgHearbeatAlarmMessage.setTrainNum(heartbeatVo.getTrainNum());
|
|
|
+ msgHearbeatAlarmMessageMapper.insert(msgHearbeatAlarmMessage);
|
|
|
//获取剩余的报警信息
|
|
|
LambdaQueryWrapper<BaseCameraManagement> ment = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
ment.ge(BaseCameraManagement::getEndMile, list.get(i).getAlarmMile());
|
|
@@ -733,11 +742,11 @@ public class GeoHazardMonitorTokenController {
|
|
|
base.lt(BaseCameraManagement::getInstallMile, distance);
|
|
|
}
|
|
|
base.eq(BaseCameraManagement::getLineDir, heartbeatVo.getLineDir());
|
|
|
- base.eq(BaseCameraManagement::getRailwayCode,heartbeatVo.getRailwayCode());
|
|
|
+ base.eq(BaseCameraManagement::getRailwayCode, heartbeatVo.getRailwayCode());
|
|
|
base.orderByAsc(BaseCameraManagement::getInstallMile);
|
|
|
base.last("limit 4");
|
|
|
List<BaseCameraManagement> list1 = baseCameraManagementService.list(base);
|
|
|
- if (list1.size()<=0){
|
|
|
+ if (list1.size() <= 0) {
|
|
|
jsonObject.put("resultCode", 0);
|
|
|
jsonObject.put("message", "失败");
|
|
|
jsonObject.put("data", "没有监控里程的相机");
|
|
@@ -1160,7 +1169,6 @@ public class GeoHazardMonitorTokenController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 天网相机心跳监测接口定义
|
|
|
*/
|
|
@@ -1211,19 +1219,19 @@ public class GeoHazardMonitorTokenController {
|
|
|
jsonObject.put("data", "相机编码不能为空");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
}
|
|
|
- SkynetHeartbeatLog skynetHeartbeatLog =new SkynetHeartbeatLog();
|
|
|
+ SkynetHeartbeatLog skynetHeartbeatLog = new SkynetHeartbeatLog();
|
|
|
skynetHeartbeatLog.setCameraCode(skynetHeartbeatVo.getCameraCode());
|
|
|
skynetHeartbeatLog.setInstallMile(skynetHeartbeatVo.getInstallMile());
|
|
|
skynetHeartbeatLog.setRailwayCode(skynetHeartbeatVo.getRailwayCode());
|
|
|
skynetHeartbeatLog.setLineDir(skynetHeartbeatVo.getLineDir());
|
|
|
- if (synetHeartbeatLogMapper.insert(skynetHeartbeatLog)>0){
|
|
|
+ if (synetHeartbeatLogMapper.insert(skynetHeartbeatLog) > 0) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("cameraCode", skynetHeartbeatVo.getCameraCode());
|
|
|
jsonObject.put("resultCode", 1);
|
|
|
jsonObject.put("message", "ok");
|
|
|
jsonObject.put("data", map);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
jsonObject.put("resultCode", 0);
|
|
|
jsonObject.put("message", "失败");
|
|
|
jsonObject.put("data", "新增失败");
|
|
@@ -1263,17 +1271,17 @@ public class GeoHazardMonitorTokenController {
|
|
|
jsonObject.put("data", "客户端编号不能为空");
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
}
|
|
|
- AlarmHeartbeatLog alarmHeartbeatLog =new AlarmHeartbeatLog();
|
|
|
+ AlarmHeartbeatLog alarmHeartbeatLog = new AlarmHeartbeatLog();
|
|
|
alarmHeartbeatLog.setClientId(svcAddress.getClientId());
|
|
|
alarmHeartbeatLog.setGrantType(svcAddress.getGrantType());
|
|
|
- if (alarmHeartbeatLogMapper.insert(alarmHeartbeatLog)>0){
|
|
|
+ if (alarmHeartbeatLogMapper.insert(alarmHeartbeatLog) > 0) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("cameraCode", svcAddress.getClientId());
|
|
|
jsonObject.put("resultCode", 1);
|
|
|
jsonObject.put("message", "ok");
|
|
|
jsonObject.put("data", map);
|
|
|
return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
jsonObject.put("resultCode", 0);
|
|
|
jsonObject.put("message", "失败");
|
|
|
jsonObject.put("data", "新增失败");
|