|
@@ -53,6 +53,21 @@ public class DataStatisticController extends BaseController {
|
|
|
private BaseCameraManagementService baseCameraManagementService;
|
|
|
@Autowired
|
|
|
private BaseTerminalService baseTerminalService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-信息统计
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查询相机总数,在线离线数量;车载终端总数,在线离线数量")
|
|
|
+ @PostMapping("/getMessageStatistics")
|
|
|
+ // @Log(title = "查询相机总数,在线离线数量;车载终端总数,在线离线数量", businessType = BusinessType.SELECT)
|
|
|
+ public AjaxResult getMessageStatistics() {
|
|
|
+ Map<String, Integer> cameraCount = baseCameraManagementService.getMessageStatisticsCamera();
|
|
|
+ return AjaxResult.success(cameraCount);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* web数据统计
|
|
|
*
|
|
@@ -182,12 +197,12 @@ public class DataStatisticController extends BaseController {
|
|
|
Integer sum = list.stream().mapToInt((x) -> Integer.parseInt(String.valueOf(x.getFrequency()))).sum();
|
|
|
NumberFormat numberFormat = NumberFormat.getPercentInstance();
|
|
|
numberFormat.setMinimumFractionDigits(2);
|
|
|
- if (!CollectionUtils.isEmpty(list) && list.size()!= 0){
|
|
|
+ if (!CollectionUtils.isEmpty(list) && list.size() != 0) {
|
|
|
list.forEach(l -> {
|
|
|
if (!ObjectUtils.isEmpty(l.getAlarmType())) {
|
|
|
l.setAlarmTypeValue(dictDataService.selectDictLabel("sys_alarm_type", String.valueOf(l.getAlarmType())));
|
|
|
}
|
|
|
- l.setPercent(numberFormat.format(l.getFrequency()*1.0 / sum));
|
|
|
+ l.setPercent(numberFormat.format(l.getFrequency() * 1.0 / sum));
|
|
|
});
|
|
|
}
|
|
|
return AjaxResult.success(list);
|
|
@@ -240,7 +255,7 @@ public class DataStatisticController extends BaseController {
|
|
|
@ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
|
|
|
@ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份")
|
|
|
})
|
|
|
- public void alarmTypeAreaCountExport(HttpServletResponse response,@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
|
|
|
+ public void alarmTypeAreaCountExport(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
|
|
|
List<AlarmFreqArea> list = msgAlarmService.alarmTypeAreaCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
alarmStatisticResVo.getCurrentMonth());
|
|
|
if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
|
|
@@ -349,20 +364,20 @@ public class DataStatisticController extends BaseController {
|
|
|
Long alarmNum = msgAlarmService.getAlarmNum();
|
|
|
Long vehicleNum = baseVehicleService.count();
|
|
|
QueryWrapper<BaseTerminal> wrapper = new QueryWrapper<BaseTerminal>();
|
|
|
- wrapper.lambda().eq(BaseTerminal::getStatus,1);
|
|
|
- Long terminalNum= baseTerminalService.count();
|
|
|
+ wrapper.lambda().eq(BaseTerminal::getStatus, 1);
|
|
|
+ Long terminalNum = baseTerminalService.count();
|
|
|
Long cameraNum = baseCameraManagementService.count();
|
|
|
- DataStatisticNum dataStatisticNum =new DataStatisticNum();
|
|
|
- if(!ObjectUtils.isEmpty(alarmNum)){
|
|
|
+ DataStatisticNum dataStatisticNum = new DataStatisticNum();
|
|
|
+ if (!ObjectUtils.isEmpty(alarmNum)) {
|
|
|
dataStatisticNum.setAlarmNum(alarmNum);
|
|
|
}
|
|
|
- if(!ObjectUtils.isEmpty(vehicleNum)){
|
|
|
+ if (!ObjectUtils.isEmpty(vehicleNum)) {
|
|
|
dataStatisticNum.setVehicleNum(vehicleNum);
|
|
|
}
|
|
|
- if(!ObjectUtils.isEmpty(terminalNum)){
|
|
|
+ if (!ObjectUtils.isEmpty(terminalNum)) {
|
|
|
dataStatisticNum.setTerminalNum(terminalNum);
|
|
|
}
|
|
|
- if(!ObjectUtils.isEmpty(cameraNum)){
|
|
|
+ if (!ObjectUtils.isEmpty(cameraNum)) {
|
|
|
dataStatisticNum.setCameraNum(cameraNum);
|
|
|
}
|
|
|
return AjaxResult.success(dataStatisticNum);
|