From 471cf8ec2f209183fe3b98499b3d32fb19ac927e Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期五, 09 八月 2024 15:35:45 +0800 Subject: [PATCH] 2024-08-09 朱宝民 统计指定月份各农户各天用水量及消费金额、统计指定年份各农户各月用水量及消费金额 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java index 948a8e2..2d103d1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java @@ -6,6 +6,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.*; import com.dy.pipIrrStatistics.intake.qo.*; +import com.dy.pipIrrStatistics.result.StatisticlResultCode; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -335,6 +336,10 @@ @GetMapping(path = "/getDayIntakeAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoDayIntakeAmount>>> getDayIntakeAmount(IntakeAmountQO qo) { + if(qo.getYearMonth() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage()); + } + try { return BaseResponseUtils.buildSuccess(intakeSv.getDayIntakeAmount(qo)); } catch (Exception e) { @@ -351,6 +356,9 @@ @GetMapping(path = "/getMonthIntakeAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoMonthAmount>>> getMonthIntakeAmount(IntakeAmountQO qo) { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage()); + } try { return BaseResponseUtils.buildSuccess(intakeSv.getMonthIntakeAmount(qo)); } catch (Exception e) { @@ -367,6 +375,10 @@ @GetMapping(path = "/getDayLossAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoDayLoss>>> getDayLossAmount(IntakeAmountQO qo) { + if(qo.getYearMonth() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage()); + } + try { return BaseResponseUtils.buildSuccess(intakeSv.getDayLossAmount(qo)); } catch (Exception e) { @@ -383,6 +395,9 @@ @GetMapping(path = "/getMonthLossAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoMonthAmount>>> getMonthLossAmount(IntakeAmountQO qo) { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage()); + } try { return BaseResponseUtils.buildSuccess(intakeSv.getMonthLossAmount(qo)); } catch (Exception e) { -- Gitblit v1.8.0