Explorar o código

Merge branch 'master' of http://124.70.58.209:3000/ytrd-project-management/VehicleMonitor

gao.qiang hai 1 ano
pai
achega
51b2516846

+ 24 - 0
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -257,8 +257,32 @@ public class MsgAlarmController extends BaseController {
                 wrapper.eq(BaseRailwayManagement::getRailwayCode, msgAlarm.getRailwayCode());
             }
             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();
             BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
+            if (!StringUtils.isEmptySunhh(baseCameraManagement)) {
+                msgAlarmResp.setCameraCode(baseCameraManagement.getCameraCode());
+            }
             if (!StringUtils.isEmptySunhh(msgAlarm.getReleasedBy())) {
 //                BaseUser user = baseUserService.getUser(msgAlarm.getReleasedBy());
 //                if (!StringUtils.isEmptySunhh(user) && !StringUtils.isEmptySunhh(user.getNickName())) {