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 | 87 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 78 insertions(+), 9 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 6c4997e..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,15 +6,6 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.*; import com.dy.pipIrrStatistics.intake.qo.*; -import com.dy.pipIrrGlobal.voSt.VoBatteryVolt; -import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow; -import com.dy.pipIrrGlobal.voSt.VoIntake; -import com.dy.pipIrrGlobal.voSt.VoSignalIntensity; -import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO; -import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount; -import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO; -import com.dy.pipIrrStatistics.intake.qo.SignalIntensityQO; -import com.dy.pipIrrStatistics.intake.qo.IntakeCountValueQO; import com.dy.pipIrrStatistics.result.StatisticlResultCode; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @@ -336,4 +327,82 @@ return BaseResponseUtils.buildException(e.getMessage()) ; } } + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲� + * @param qo + * @return + */ + @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) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 缁熻鎸囧畾骞翠唤鍚勬湀鐢ㄦ按閲� + * @param qo + * @return + */ + @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) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫ぉ婕忔崯閲� + * @param qo + * @return + */ + @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) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 缁熻鎸囧畾骞翠唤鍚勬湀婕忔崯閲� + * @param qo + * @return + */ + @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) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } } -- Gitblit v1.8.0