feiyu02
2025-03-21 e5bdf2e02090357cbd580d54e6cd2406dd541760
src/main/kotlin/com/flightfeather/uav/lightshare/web/ElectricityController.kt
@@ -23,4 +23,38 @@
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getMinuteData(deviceCode, startTime, endTime, page, perPage)
    @ApiOperation(value = "获取企业用电量分钟均值,结果格式为走航数据格式")
    @GetMapping("/minute2")
    fun getMinuteData2(
        @ApiParam("设备编号") @RequestParam(value = "deviceCode") deviceCode: String,
        @ApiParam(value = "开始时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "startTime", required = false) startTime: String?,
        @ApiParam(value = "结束时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "endTime", required = false) endTime: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getMinuteData2(deviceCode, startTime, endTime, page, perPage)
    @ApiOperation(value = "获取企业用电量最新一条分钟均值")
    @GetMapping("/company")
    fun  getByCompany(
        @ApiParam("企业id") @RequestParam(value = "cId") cId: String,
    ) = electricityService.getByCompany(cId)
    @ApiOperation(value = "获取企业用电量整合数据")
    @GetMapping("/info")
    fun  getElectricityInfo(
        @ApiParam("企业id") @RequestParam(value = "cId") cId: String,
        @ApiParam(value = "开始时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "startTime", required = false) startTime: String?,
        @ApiParam(value = "结束时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "endTime", required = false) endTime: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getElectricityInfo(cId, startTime, endTime, page, perPage)
    @ApiOperation(value = "企业用电量日分析")
    @GetMapping("/analysis/daily")
    fun dailyStatistics(
        @ApiParam("企业id") @RequestParam(value = "cId") cId: String,
        @ApiParam(value = "开始时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "startTime", required = false) startTime: String?,
        @ApiParam(value = "结束时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "endTime", required = false) endTime: String?,
    ) = electricityService.dailyAnalysis(cId, startTime, endTime)
}