|
@@ -3,8 +3,13 @@ package cn.iocoder.yudao.module.pms.controller.admin.alarm;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmRespVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.alarm.vo.IotVideoAlarmSaveReqVO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.alarm.IotVideoAlarmDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.alarm.IotVideoAlarmDO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.sip.device.channel.YfSipDeviceChannelDO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.yanfan.sip.device.channel.YfSipDeviceChannelMapper;
|
|
|
import cn.iocoder.yudao.module.pms.service.alarm.IotVideoAlarmService;
|
|
import cn.iocoder.yudao.module.pms.service.alarm.IotVideoAlarmService;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.yanfan.sip.device.channel.YfSipDeviceChannelService;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -14,6 +19,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
@@ -40,6 +46,8 @@ public class IotVideoAlarmController {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private IotVideoAlarmService iotVideoAlarmService;
|
|
private IotVideoAlarmService iotVideoAlarmService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private YfSipDeviceChannelMapper yfsipDeviceChannelMapper;
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建资料")
|
|
@Operation(summary = "创建资料")
|
|
@@ -75,11 +83,23 @@ public class IotVideoAlarmController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/page")
|
|
@GetMapping("/page")
|
|
|
- @Operation(summary = "获得资料分页")
|
|
|
|
|
|
|
+ @Operation(summary = "获得视频告警分页")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-video-alarm:query')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-video-alarm:query')")
|
|
|
public CommonResult<PageResult<IotVideoAlarmRespVO>> getIotVideoAlarmPage(@Valid IotVideoAlarmPageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<IotVideoAlarmRespVO>> getIotVideoAlarmPage(@Valid IotVideoAlarmPageReqVO pageReqVO) {
|
|
|
PageResult<IotVideoAlarmDO> pageResult = iotVideoAlarmService.getIotVideoAlarmPage(pageReqVO);
|
|
PageResult<IotVideoAlarmDO> pageResult = iotVideoAlarmService.getIotVideoAlarmPage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, IotVideoAlarmRespVO.class));
|
|
|
|
|
|
|
+ List<IotVideoAlarmRespVO> collect = pageResult.getList().stream().map(e -> {
|
|
|
|
|
+ IotVideoAlarmRespVO iotVideoAlarmRespVO = new IotVideoAlarmRespVO();
|
|
|
|
|
+ BeanUtils.copyProperties(e, iotVideoAlarmRespVO);
|
|
|
|
|
+ if (StringUtils.isNotBlank(e.getBusinessChannel())) {
|
|
|
|
|
+ YfSipDeviceChannelDO yfSipDeviceChannelDO = yfsipDeviceChannelMapper.selectSipDeviceChannelByChannelSipId(e.getBusinessChannel());
|
|
|
|
|
+ if (yfSipDeviceChannelDO != null) {
|
|
|
|
|
+ iotVideoAlarmRespVO.setDeviceName(yfSipDeviceChannelDO.getDeviceSipId());
|
|
|
|
|
+ iotVideoAlarmRespVO.setChannelName(yfSipDeviceChannelDO.getChannelName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return iotVideoAlarmRespVO;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+ return success(new PageResult<>(collect, pageResult.getTotal()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
@GetMapping("/export-excel")
|