Browse Source

相机树开发

gao.qiang 2 months ago
parent
commit
952220ba20

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -141,7 +141,7 @@ public class BaseCameraManagementController extends BaseController {
             baseCameraManagement.setIsDisable(deviceDynamicManagement.getIsDisable());
             baseCameraManagement.setElectricity(deviceDynamicManagement.getElectricity() + "%");
             List<MqLog> list = mqLogService.list(new LambdaQueryWrapper<MqLog>()
-                    .eq(MqLog::getCameraCode, cameraCode));
+                    .eq(MqLog::getCameraCode, cameraCode).orderByDesc(MqLog::getCreateTime));
             if (!ObjectUtils.isEmpty(list)) {
                 baseCameraManagement.setHeartTime(list.get(0).getCreateTime());
             }
@@ -192,7 +192,7 @@ public class BaseCameraManagementController extends BaseController {
             msgAlarmResp.setIsDisable(deviceDynamicManagement.getIsDisable());
             msgAlarmResp.setElectricity(deviceDynamicManagement.getElectricity() + "%");
             List<MqLog> list = mqLogService.list(new LambdaQueryWrapper<MqLog>()
-                    .eq(MqLog::getCameraCode, cameraCode));
+                    .eq(MqLog::getCameraCode, cameraCode).orderByDesc(MqLog::getCreateTime));
             if (!ObjectUtils.isEmpty(list)) {
                 msgAlarmResp.setHeartTime(list.get(0).getCreateTime());
             }