| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | 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 |
| | |
| | | |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | |
| | | @Autowired |
| | | private AppParamService appParamService; |
| | | |
| | | @ApiOperation(value = "电源信息统计(1.2.1/1.2.13)") |
| | | @PostMapping("getPowerStatistic") |
| | |
| | | stic.setUid(uinf.getId()); |
| | | return battTinfService.getDischr5Statistic(stic); |
| | | } |
| | | @ApiOperation(value = "本年度已放电数量统计右侧图表(1.2.5/6)") |
| | | @PostMapping("getDischr5Chart") |
| | | public Response getDischr5Chart(){ |
| | | User uinf= ActionUtil.getUser(); |
| | | return battTinfService.getDischr5Chart(uinf.getId()); |
| | | } |
| | | @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){ |
| | | /*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){ |
| | | 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)") |
| | | @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 = "站点信息统计(1.2.11)") |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | } |