From f998f917f90d86499bf8a24c8912e270655e4d43 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期二, 24 六月 2025 17:27:57 +0800 Subject: [PATCH] 预警分析修改 --- src/main/java/com/whyc/controller/BattCompareController.java | 47 +++++++++++++++++++++++++++++------------------ 1 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/whyc/controller/BattCompareController.java b/src/main/java/com/whyc/controller/BattCompareController.java index f8ea218..5ded782 100644 --- a/src/main/java/com/whyc/controller/BattCompareController.java +++ b/src/main/java/com/whyc/controller/BattCompareController.java @@ -3,15 +3,16 @@ import com.whyc.dto.Response; import com.whyc.dto.Statistic.BattCompareStic; import com.whyc.pojo.db_user.User; +import com.whyc.service.BattresdataInfService; import com.whyc.service.BatttestdataInfService; 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.text.ParseException; +import java.util.Map; @RestController @Api(tags = "钃勭數姹犲姣斿垎鏋愮鐞�") @@ -21,28 +22,38 @@ @Autowired private BatttestdataInfService battTinfService; + @Autowired + private BattresdataInfService battRinfService; - @ApiOperation(value = "钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堝悓涓�鍝佺墝鍚屼竴鏃堕棿锛�(1.2.15)") + + @ApiOperation(value = "钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堝悓涓�鏃堕棿鍚屼竴鍝佺墝/鍚屼竴鏃堕棿涓嶅悓涓�鍝佺墝/涓嶅悓涓�鏃堕棿鍚屼竴鍝佺墝锛�(1.2.15/16/17)") @PostMapping("getBattCompare15Statistic") - public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic){ + public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic) throws ParseException { User uinf= ActionUtil.getUser(); stic.setUid(uinf.getId()); + if(stic.getInuserYear()!=null){ + int year=ActionUtil.getNowYear(); + stic.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-stic.getInuserYear(),0,1,5))); + stic.setInuseEndTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year,11,31,5))); + } 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.15/16/17)") + @GetMapping("getRealCapChangeByBattgroupId") + public Response getRealCapChangeByBattgroupId(@RequestParam Integer battgroupId){ + return battTinfService.getRealCapChangeByBattgroupId(battgroupId); } - @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.15/16/17)") + @GetMapping("getFloatGroupVolChangeByBattgroupId") + public Response getFloatGroupVolChangeByBattgroupId(@RequestParam Integer battgroupId){ + return battTinfService.getFloatGroupVolChangeByBattgroupId(battgroupId); + } + + @ApiOperation(value = "鐐瑰嚮鍙充晶鎶樼嚎鍥剧敾鍑虹數姹犵粍鍗曚綋鐨勬墍鏈夊唴闃绘祴璇曞崟浣撳唴闃诲彉鍖栧浘(1.2.15/16/17)") + @GetMapping("getMonResChangeByBattgroupId") + public Response getMonResChangeByBattgroupId(@RequestParam Integer battgroupId,@RequestParam Integer monNum){ + return battRinfService.getMonResChangeByBattgroupId(battgroupId,monNum); } } \ No newline at end of file -- Gitblit v1.9.1