From 765e33b30a4ecd81a9634a12dc01d4cc5564168b Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期二, 06 五月 2025 17:23:39 +0800 Subject: [PATCH] 获取一个取水口接口返回值增加控制器地址和通讯协议字段 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java index e1fab95..066894a 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java @@ -6,6 +6,8 @@ import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.VoStClientAmountDay; +import com.dy.pipIrrGlobal.voSt.VoStClientAmountMonth; +import com.dy.pipIrrGlobal.voSt.VoStClientAmountYear; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; /** @@ -25,6 +28,8 @@ @RequestMapping(path="stClient") @RequiredArgsConstructor public class StClientCtrl { + + private static final int startYear4YearStatistics = 2024 ; private StClientSv sv ; @@ -50,4 +55,53 @@ qo.month = ymd[1] ; return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountDay(qo)); } + + + /** + * 鏌ヨ鎸囧畾骞村啘鎴峰悇鏈堢敤姘撮噺 + * @param qo + * @return + */ + @GetMapping(path = "/amountOfMonth") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoStClientAmountMonth>>> amountOfMonth(StClientQo qo) throws Exception { + if(qo.year == null) { + return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞村害涓嶈兘涓虹┖"); + } + return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountMonth(qo)); + } + + + + /** + * 鏌ヨ鎸囧畾骞村啘鎴峰悇骞寸敤姘撮噺 + * @param qo + * @return + */ + @GetMapping(path = "/amountOfYear") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoStClientAmountYear>>> amountOfYear(StClientQo qo) throws Exception { + List<Integer> yearGrp = new ArrayList<Integer>(); + int nowYear = Integer.parseInt(DateTime.yyyy()) ; + if(qo.year == null) { + int startYear = nowYear - 4 ;//鏌�5骞寸殑 + if(startYear < startYear4YearStatistics){ + startYear = startYear4YearStatistics ; + } + for(int i = startYear; i <= nowYear; i++) { + yearGrp.add(i) ; + } + }else{ + /* + if(qo.year > nowYear){ + qo.year = nowYear; + } + if(qo.year < startYear4YearStatistics){ + qo.year = startYear4YearStatistics; + } + */ + yearGrp.add(qo.year) ; + } + return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountYear(qo, yearGrp)); + } } -- Gitblit v1.8.0