Browse Source

添加频繁出现灾害地点排名导出接口

wyyay 2 years ago
parent
commit
63d9b03e46

+ 3 - 0
business-service/src/main/java/com/ozs/entity/vo/AlarmFreqArea.java

@@ -14,6 +14,7 @@ public class AlarmFreqArea {
     /**
      * 线路名称
      */
+    @Excel(name = "线路名称")
     private String railwayName;
 
     /**
@@ -29,10 +30,12 @@ public class AlarmFreqArea {
     /**
      * 报警里程位置字符串形式
      */
+    @Excel(name = "报警里程位置")
     private String alarmMiles;
 
     /**
      * 报警频次
      */
+    @Excel(name = "报警频次")
     private Integer frequency;
 }

+ 28 - 0
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/DataStatisticController.java

@@ -227,6 +227,34 @@ public class DataStatisticController extends BaseController {
         return AjaxResult.success(null);
     }
 
+    /**
+     * web数据统计
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "频繁出现灾害地点排导出", businessType = BusinessType.EXPORT)
+    @PostMapping("/alarmTypeAreaCountExport")
+    @ApiOperation(value = "web数据统计 频繁出现灾害地点排名导出")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(paramType = "query", name = "railwayCode", value = "线路编码"),
+            @ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
+            @ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份")
+    })
+    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))) {
+            list.forEach(l -> {
+                if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
+                    l.setAlarmMiles(AppendUtils.stringAppend(Integer.valueOf(l.getAlarmMile())));
+                }
+            });
+            ExcelUtil<AlarmFreqArea> util = new ExcelUtil<>(AlarmFreqArea.class);
+            util.exportExcel(response, list, "频繁出现灾害地点排导出");
+        }
+    }
+
     /**
      * web数据统计 数据导出
      *