package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.dto.Statistic.BattTinfStic; import com.whyc.dto.Statistic.DeviceStateStic; import com.whyc.dto.Statistic.StationStic; import com.whyc.pojo.db_user.User; import com.whyc.service.*; import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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; @RestController @Api(tags = "统计管理") @RequestMapping("statistic") public class StatisticController { @Autowired private StationInfService stationInfService; @Autowired private BatttestdataInfService battTinfService; @Autowired private BattInfService battService; @Autowired private PowerInfService powerInfService; @Autowired private DeviceStateService deviceStateService; @ApiOperation(value = "电源信息统计") @PostMapping("getPowerStatistic") public Response getPowerStatistic(@RequestBody StationStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return powerInfService.getPowerStatistic(stic); } @ApiOperation(value = "设备信息统计") @PostMapping("getDevStatistic") public Response getDevStatistic(@RequestBody StationStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return battService.getDevStatistic(stic); } @ApiOperation(value = "蓄电池组信息统计") @PostMapping("getBattStatistic") public Response getBattStatistic(@RequestBody StationStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return battService.getBattStatistic(stic); } @ApiOperation(value = "站点信息统计") @PostMapping("getStationStatistic") public Response getStationStatistic(@RequestBody StationStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return stationInfService.getStationStatistic(stic); } @ApiOperation(value = "蓄电池核容信息统计") @PostMapping("getBattTinfStatistic") public Response getBattTinfStatistic(@RequestBody BattTinfStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return battTinfService.getBattTinfStatistic(stic); } @ApiOperation(value = "设备工作状态统计") @PostMapping("getDeviceStateStatistic") public Response getDeviceStateStatistic(@RequestBody DeviceStateStic stic){ User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); return deviceStateService.getDeviceStateStatistic(stic); } }