| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.sxkj.fw.cockpit.service.ICockpitService; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO; |
| | | import org.sxkj.fw.detection.dto.FwEffectEvalDTO; |
| | | import org.sxkj.fw.detection.entity.FwEffectEvalEntity; |
| | | import org.sxkj.fw.detection.service.IFwEffectEvalService; |
| | | import org.sxkj.fw.detection.param.FwEffectEvalParam; |
| | | import org.sxkj.fw.device.dto.FwDeviceDTO; |
| | | import org.sxkj.fw.device.entity.FwDeviceEntity; |
| | | import org.sxkj.fw.device.service.IFwDeviceService; |
| | | import org.sxkj.fw.device.vo.FwDeviceVO; |
| | | import org.sxkj.fw.device.wrapper.FwDeviceWrapper; |
| | | import org.sxkj.fw.device.vo.CockpitFwDeviceVO; |
| | | import org.sxkj.fw.record.dto.FwDroneAlarmRecordDTO; |
| | | import org.sxkj.fw.record.service.IFwDroneAlarmRecordService; |
| | | import org.sxkj.fw.record.vo.FwDroneAlarmRecordVO; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Objects; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据驾驶舱 |
| | |
| | | @Api(value = "驾驶舱", tags = "数据驾驶舱") |
| | | public class CockpitController { |
| | | |
| | | private final IFwDroneAlarmRecordService fwDroneAlarmRecordService; |
| | | |
| | | private final IFwDeviceService fwDeviceService; |
| | | |
| | | private final IFwEffectEvalService fwEffectEvalService; |
| | | private final ICockpitService cockpitService; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "历史告警/实时告警", notes = "传入fwDroneAlarmRecord") |
| | | public R<IPage<FwDroneAlarmRecordVO>> page(FwDroneAlarmRecordDTO fwDroneAlarmRecord, Query query) { |
| | | IPage<FwDroneAlarmRecordVO> pages = fwDroneAlarmRecordService.selectFwDroneAlarmRecordPage(Condition.getPage(query), fwDroneAlarmRecord); |
| | | IPage<FwDroneAlarmRecordVO> pages = cockpitService.selectFwDroneAlarmRecordPage(Condition.getPage(query), fwDroneAlarmRecord); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @GetMapping("/deviceSearch") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "设备查询", notes = "传入fwDevice") |
| | | public R<IPage<FwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) { |
| | | IPage<FwDeviceEntity> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), fwDevice); |
| | | return R.data(FwDeviceWrapper.build().pageVO(pages)); |
| | | public R<IPage<CockpitFwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) { |
| | | IPage<CockpitFwDeviceVO> pages = cockpitService.selectCockpitDevicePage(Condition.getPage(query), fwDevice); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/deviceStatistics") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "设备统计", notes = "返回设备统计、无线电、光电、雷达等数据") |
| | | public R<DeviceStatisticsVO> getDeviceStatistics() { |
| | | DeviceStatisticsVO statistics = new DeviceStatisticsVO(); |
| | | // 假设从服务层获取统计数据,这里仅示例填充数据 |
| | | statistics.setDetectCount(3); |
| | | statistics.setCountermeasuresCount(4); |
| | | @ApiOperation(value = "设备统计", notes = "返回侦测设备,反制设备数量") |
| | | public R<List<DeviceStatisticsVO>> getDeviceStatistics() { |
| | | List<DeviceStatisticsVO> statistics = cockpitService.statisticalDeviceType(); |
| | | return R.data(statistics); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "告警记录统计", notes = "返回实时告警、设备告警、历史告警数量") |
| | | public R<AlarmStatisticsVO> getAlarmStatistics() { |
| | | AlarmStatisticsVO statistics = new AlarmStatisticsVO(); |
| | | // 假设从服务层获取统计数据,这里仅示例填充数据 |
| | | statistics.setDeviceCount(5); |
| | | statistics.setRadioCount(1); |
| | | statistics.setOpticalCount(2); |
| | | statistics.setRadarCount(2); |
| | | statistics.setRealTimeAlarmCount(5); |
| | | statistics.setDeviceAlarmCount(5); |
| | | statistics.setHistoryAlarmCount(5); |
| | | AlarmStatisticsVO statistics = cockpitService.statisticsAlarmsAndDeviceRecords(); |
| | | return R.data(statistics); |
| | | } |
| | | |
| | |
| | | @PostMapping("/interferenceAndExpulsion") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "信号干扰,诱导驱离", notes = "传入fwEffectEval") |
| | | public R submit(@Valid @RequestBody FwEffectEvalDTO fwEffectEval) { |
| | | FwEffectEvalEntity fwEffectEvalEntity = Objects.requireNonNull(BeanUtil.copy(fwEffectEval, FwEffectEvalEntity.class)); |
| | | return R.status(fwEffectEvalService.saveOrUpdate(fwEffectEvalEntity)); |
| | | public R interferenceAndExpulsion(@Valid @RequestBody FwEffectEvalParam fwEffectEvalParam) { |
| | | return R.status(cockpitService.interferenceAndExpulsion(fwEffectEvalParam)); |
| | | } |
| | | } |