| | |
| | | package com.ruoyi.statistical.controller; |
| | | |
| | | import com.ruoyi.statistical.param.ESParam; |
| | | import com.ruoyi.statistical.service.StatisticalService; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 厂区介绍存储 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('minio:event:export')") |
| | | @ApiOperation("根据权限获取设备列表") |
| | | @ApiOperation("厂区介绍存储") |
| | | @PostMapping("factory/save") |
| | | public Results factorySave(@RequestBody Map<String,String> map){ |
| | | return statisticalService.factorySave(map); |
| | | } |
| | | |
| | | /** |
| | | * 厂区介绍查询 |
| | | */ |
| | | @ApiOperation("厂区介绍查询") |
| | | @GetMapping("factory/select") |
| | | public Results factorySelect(){ |
| | | return statisticalService.factorySelect(); |
| | | } |
| | | |
| | | /** |
| | | * 报警数量分析年 |
| | | */ |
| | | @ApiOperation("报警数量分析年") |
| | | @GetMapping("alarm/year") |
| | | public Results alarmYear(String type){ |
| | | LocalDate today = LocalDate.now(); |
| | | int year = today.getYear(); |
| | | ESParam esParam = new ESParam(); |
| | | esParam.setStart(year+"-01-01"); |
| | | esParam.setEnd(year+"-12-31"); |
| | | if("1001".equals(type)){ |
| | | //盗电报警 |
| | | return Results.succeed(statisticalService.stealelecYear(esParam)); |
| | | }else if("1002".equals(type)){ |
| | | //通用光电 |
| | | return Results.succeed(statisticalService.cameraYear(esParam)); |
| | | }else if("1003".equals(type)){ |
| | | //雷达报警 |
| | | return Results.succeed(statisticalService.moveYear(esParam)); |
| | | }else if("1004".equals(type)){ |
| | | //防火报警 |
| | | return Results.succeed(statisticalService.fireYear(esParam)); |
| | | }else if("1005".equals(type)){ |
| | | //外联报警 |
| | | return Results.succeed(statisticalService.externalYear(esParam)); |
| | | }else if("1006".equals(type)){ |
| | | //门禁报警 |
| | | return Results.succeed(statisticalService.accessYear(esParam)); |
| | | }else if("1007".equals(type)){ |
| | | //移动终端 |
| | | return Results.succeed(statisticalService.apponekeyYear(esParam)); |
| | | }else if("1010".equals(type)){ |
| | | //电子围栏 |
| | | return Results.succeed(statisticalService.wallYear(esParam)); |
| | | }else if("1012".equals(type)){ |
| | | //预警告警 |
| | | return Results.succeed(statisticalService.digitizationYear(esParam)); |
| | | }else if("1014".equals(type)){ |
| | | //管线泄漏 |
| | | return Results.succeed(statisticalService.tubeYear(esParam)); |
| | | } |
| | | return Results.succeed(); |
| | | } |
| | | |
| | | } |