| | |
| | | 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.MonStic; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.dto.Statistic.*; |
| | | import com.whyc.pojo.db_param.AppParam; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(tags = "统计管理") |
| | |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService battTinfService; |
| | | |
| | | @Autowired |
| | | private BattInfService battService; |
| | | |
| | |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | |
| | | @ApiOperation(value = "电源信息统计") |
| | | @Autowired |
| | | private AppParamService appParamService; |
| | | |
| | | @ApiOperation(value = "电源信息统计(1.2.1/1.2.13)") |
| | | @PostMapping("getPowerStatistic") |
| | | public Response getPowerStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | |
| | | return powerInfService.getPowerStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备信息统计") |
| | | @ApiOperation(value = "设备信息统计(1.2.2)") |
| | | @PostMapping("getDevStatistic") |
| | | public Response getDevStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | |
| | | return battService.getDevStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池组信息统计") |
| | | @ApiOperation(value = "蓄电池组信息统计(1.2.3/1.2.12)") |
| | | @PostMapping("getBattStatistic") |
| | | public Response getBattStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | |
| | | return battService.getBattStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "单节数量统计") |
| | | @ApiOperation(value = "单节数量统计(1.2.4)") |
| | | @PostMapping("getMonStatistic") |
| | | public Response getMonStatistic(@RequestBody MonStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getMonStatistic(stic); |
| | | Map<String,Object> map= battTinfService.getMonStatistic(stic); |
| | | return new Response().setII(1,true,map,"单节数量统计"); |
| | | } |
| | | |
| | | @ApiOperation(value = "本年度已放电数量统计(1.2.5)") |
| | | @PostMapping("getDischr5Statistic") |
| | | public Response getDischr5Statistic(@RequestBody DisChargeStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getDischr5Statistic(stic); |
| | | } |
| | | @ApiOperation(value = "本年度未放电数量统计(1.2.6)") |
| | | @PostMapping("getDischr6Statistic") |
| | | public Response getDischr6Statistic(@RequestBody DisChargeStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | /*if(stic.getTypeList()==null||stic.getTypeList().size()==0){ |
| | | stic.setStopReasonType(0); |
| | | }else{ |
| | | stic.setStopReasonType(1); |
| | | }*/ |
| | | return battTinfService.getDischr6Statistic(stic); |
| | | } |
| | | @ApiOperation(value = "优良电源数量统计(1.2.7)") |
| | | @PostMapping("getPwr7Statistic") |
| | | public Response getPwr7Statistic(@RequestBody Pwr7Stic stic) throws NoSuchFieldException, IllegalAccessException { |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getPwr7Statistic(stic); |
| | | } |
| | | @ApiOperation(value = "电池组电池性能统计(优秀,劣化,损坏<按照容量统计>)统计(1.2.8/9/10)") |
| | | @PostMapping("getPerformanceStatistic") |
| | | public Response getPerformanceStatistic(@RequestBody PerformanceStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getPerformanceStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "电池组电池性能统计(劣化<按照单体电压+内阻统计>)统计(1.2.9)") |
| | | @PostMapping("getPerVolAndRes9Statistic") |
| | | public Response getPerVolAndRes9Statistic(@RequestBody PerformanceStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getPerVolAndRes9Statistic(stic); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "站点信息统计") |
| | | |
| | | @ApiOperation(value = "站点信息统计(1.2.11)") |
| | | @PostMapping("getStationStatistic") |
| | | public Response getStationStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | |
| | | return stationInfService.getStationStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池核容信息统计") |
| | | @ApiOperation(value = "蓄电池核容信息统计(1.2.14)") |
| | | @PostMapping("getBattTinfStatistic") |
| | | public Response getBattTinfStatistic(@RequestBody BattTinfStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattTinfStatistic(stic); |
| | | } |
| | | /* @ApiOperation(value = "蓄电池组对比分析界面(同一品牌同一时间)(1.2.15)") |
| | | @PostMapping("getBattCompare15Statistic") |
| | | public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare15Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备工作状态统计") |
| | | @ApiOperation(value = "蓄电池组对比分析界面(不同品牌同一时间)(1.2.16)") |
| | | @PostMapping("getBattCompare16Statistic") |
| | | public Response getBattCompare16Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare16Statistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "蓄电池组对比分析界面(同一品牌不同时间)(1.2.17)") |
| | | @PostMapping("getBattCompare17Statistic") |
| | | public Response getBattCompare17Statistic(@RequestBody BattCompareStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getBattCompare17Statistic(stic); |
| | | }*/ |
| | | |
| | | @ApiOperation(value = "设备工作状态统计(1.2.21)") |
| | | @PostMapping("getDeviceStateStatistic") |
| | | public Response getDeviceStateStatistic(@RequestBody DeviceStateStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return deviceStateService.getDeviceStateStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置权重(1.2.16)") |
| | | @PostMapping("setHehavior") |
| | | public Response setHehavior(@RequestBody List<AppParam> List){ |
| | | return appParamService.setHehavior(List); |
| | | } |
| | | |
| | | @ApiOperation(value = "读取权重(1.2.16)") |
| | | @GetMapping("getHehavior") |
| | | public Response getHehavior(){ |
| | | return appParamService.getHehavior(); |
| | | } |
| | | |
| | | |
| | | } |