|
@@ -471,31 +471,35 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
queryWrapper.orderByDesc(MsgAlarm::getCreateTime);
|
|
|
}
|
|
|
List<MsgAlarm> msgAlarmList = msgAlarmService.list(queryWrapper);
|
|
|
- MsgAlarm msgAlarm = msgAlarmList.get(0);
|
|
|
- LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
- if (!ObjectUtils.isEmpty(cameraCode)) {
|
|
|
- lw.eq(BaseCameraManagement::getCameraCode, cameraCode);
|
|
|
- }
|
|
|
- BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(lw);
|
|
|
- LambdaQueryWrapper<BaseRailwayManagement> wrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
- if (!ObjectUtils.isEmpty(baseCameraManagement.getRailwayCode())) {
|
|
|
- wrapper.eq(BaseRailwayManagement::getRailwayCode, baseCameraManagement.getRailwayCode());
|
|
|
+ if (msgAlarmList.size()>0) {
|
|
|
+ MsgAlarm msgAlarm = msgAlarmList.get(0);
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
+ if (!ObjectUtils.isEmpty(cameraCode)) {
|
|
|
+ lw.eq(BaseCameraManagement::getCameraCode, cameraCode);
|
|
|
+ }
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(lw);
|
|
|
+ LambdaQueryWrapper<BaseRailwayManagement> wrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getRailwayCode())) {
|
|
|
+ wrapper.eq(BaseRailwayManagement::getRailwayCode, baseCameraManagement.getRailwayCode());
|
|
|
+ }
|
|
|
+ BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(wrapper);
|
|
|
+ MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
|
+ BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
|
+ msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
+ msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
|
+ String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
+ String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
+ String endMile = begin + end;
|
|
|
+ msgAlarmResp.setBeginMile(endMile);
|
|
|
+ String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
|
+ msgAlarmResp.setAlarmMile(mile);
|
|
|
+ msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
|
+ msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
|
|
|
+ msgAlarmResp.setAlarmMile(baseCameraManagement.getInstallMile().toString());
|
|
|
+ return AjaxResult.success(msgAlarmResp);
|
|
|
+ }else {
|
|
|
+ return error("该相机没有报警消息");
|
|
|
}
|
|
|
- BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(wrapper);
|
|
|
- MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
|
- BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
|
- msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
- msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
|
- String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
- String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
- String endMile = begin + end;
|
|
|
- msgAlarmResp.setBeginMile(endMile);
|
|
|
- String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
|
- msgAlarmResp.setAlarmMile(mile);
|
|
|
- msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
|
- msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
|
|
|
- msgAlarmResp.setAlarmMile(baseCameraManagement.getInstallMile().toString());
|
|
|
- return AjaxResult.success(msgAlarmResp);
|
|
|
}
|
|
|
}
|
|
|
|