From add5c816a5281cf6b1df4a0988e8b3a0c2b59bee Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期三, 25 六月 2025 17:37:03 +0800 Subject: [PATCH] 电源表和电池信息表加入新的字段,添加,编辑需要修改 --- src/main/java/com/whyc/controller/StatisticController.java | 87 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 78 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/whyc/controller/StatisticController.java b/src/main/java/com/whyc/controller/StatisticController.java index c45d3b4..495d3f2 100644 --- a/src/main/java/com/whyc/controller/StatisticController.java +++ b/src/main/java/com/whyc/controller/StatisticController.java @@ -1,20 +1,18 @@ 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 = "缁熻绠$悊") @@ -25,6 +23,7 @@ @Autowired private BatttestdataInfService battTinfService; + @Autowired private BattInfService battService; @@ -33,6 +32,7 @@ @Autowired private DeviceStateService deviceStateService; + @ApiOperation(value = "鐢垫簮淇℃伅缁熻(1.2.1/1.2.13)") @PostMapping("getPowerStatistic") @@ -63,8 +63,52 @@ 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 = "绔欑偣淇℃伅缁熻(1.2.11)") @@ -82,6 +126,29 @@ 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 = "钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堜笉鍚屽搧鐗屽悓涓�鏃堕棿锛�(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") @@ -90,4 +157,6 @@ stic.setUid(uinf.getId()); return deviceStateService.getDeviceStateStatistic(stic); } + + } \ No newline at end of file -- Gitblit v1.9.1