|
@@ -257,8 +257,32 @@ public class MsgAlarmController extends BaseController {
|
|
wrapper.eq(BaseRailwayManagement::getRailwayCode, msgAlarm.getRailwayCode());
|
|
wrapper.eq(BaseRailwayManagement::getRailwayCode, msgAlarm.getRailwayCode());
|
|
}
|
|
}
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(wrapper);
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(wrapper);
|
|
|
|
+// if (StringUtils.isEmptySunhh(baseRailwayManagement)) {
|
|
|
|
+// return AjaxResult.error("线路编码:" + msgAlarm.getRailwayCode() + "不存在!");
|
|
|
|
+// }
|
|
|
|
+ // 查询里程位置最近的相机
|
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<>();
|
|
|
|
+ if (!StringUtils.isEmptySunhh(msgAlarm.getRailwayCode())) {
|
|
|
|
+ lw.eq(BaseCameraManagement::getRailwayCode, msgAlarm.getRailwayCode());
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmptySunhh(msgAlarm.getAlarmMile())) {
|
|
|
|
+ lw.le(BaseCameraManagement::getBeginMile, msgAlarm.getAlarmMile());
|
|
|
|
+ lw.gt(BaseCameraManagement::getEndMile, msgAlarm.getAlarmMile());
|
|
|
|
+ }
|
|
|
|
+ List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(lw);
|
|
|
|
+ BaseCameraManagement baseCameraManagement = new BaseCameraManagement();
|
|
|
|
+ if (!StringUtils.isEmptySunhh(baseCameraManagementList) && baseCameraManagementList.size() > 0) {
|
|
|
|
+ baseCameraManagement = baseCameraManagementList.get(0);
|
|
|
|
+ }
|
|
|
|
+// BaseCameraManagement baseCameraManagement = baseCameraManagementMapper.selectOne(lw);
|
|
|
|
+// if (StringUtils.isEmptySunhh(baseCameraManagement)) {
|
|
|
|
+// return AjaxResult.error("线路编码:" + msgAlarm.getRailwayCode() + "不存在对应里程范围为:"+ msgAlarm.getAlarmMile() +"的相机!");
|
|
|
|
+// }
|
|
MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
|
|
+ if (!StringUtils.isEmptySunhh(baseCameraManagement)) {
|
|
|
|
+ msgAlarmResp.setCameraCode(baseCameraManagement.getCameraCode());
|
|
|
|
+ }
|
|
if (!StringUtils.isEmptySunhh(msgAlarm.getReleasedBy())) {
|
|
if (!StringUtils.isEmptySunhh(msgAlarm.getReleasedBy())) {
|
|
// BaseUser user = baseUserService.getUser(msgAlarm.getReleasedBy());
|
|
// BaseUser user = baseUserService.getUser(msgAlarm.getReleasedBy());
|
|
// if (!StringUtils.isEmptySunhh(user) && !StringUtils.isEmptySunhh(user.getNickName())) {
|
|
// if (!StringUtils.isEmptySunhh(user) && !StringUtils.isEmptySunhh(user.getNickName())) {
|