From db31f95644e77010ffb88ac9e57e618818737733 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 09 一月 2025 11:25:23 +0800 Subject: [PATCH] 优化”开阀操作次数“、”关阀操作次数“、”时间段内开阀次数超过指定值“、”时间段内开阀次数低于指定值“、”时间段有开阀无关阀“、”时间段无开阀有关阀“功能实现及sql。 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java index df89ee5..bfcade6 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java @@ -4,15 +4,21 @@ import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.voSt.VoCardUsage; import com.dy.pipIrrGlobal.voSt.VoICCard; import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; +import com.dy.pipIrrStatistics.card.qo.CardUsageQO; +import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; +import java.util.Map; +import java.util.Objects; /** * @author ZhuBaoMin @@ -102,4 +108,46 @@ return BaseResponseUtils.buildException(e.getMessage()); } } + + /** + * 鑾峰彇鎸囧畾鏃堕棿娈垫按鍗′娇鐢ㄦ儏鍐碉細鍏呭�煎悎璁°�佹秷璐瑰悎璁°�佷綑棰� + * @param qo + //* @param bindingResult + * @return + */ + @GetMapping(path = "/card_usage") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoCardUsage>>> getCardUsages(@Valid CardUsageQO qo, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + try { + return BaseResponseUtils.buildSuccess(icCardSv.getCardUsages(qo)); + } catch (Exception e) { + log.error("鑾峰彇寮�鍗¤褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鑾峰彇鍞按鎬昏淇℃伅锛氬厖鍊奸噾棰濇�昏銆佹按琛ㄦ秷璐归噾棰濇�昏 + * @param qo + * @param bindingResult + * @return + */ + @GetMapping(path = "/total_water_use") + @SsoAop() + public BaseResponse<Map> getTotalWaterUse(@Valid CardUsageQO qo, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + try { + return BaseResponseUtils.buildSuccess(icCardSv.getTotalWaterUse(qo)); + } catch (Exception e) { + log.error("鑾峰彇寮�鍗¤褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } } -- Gitblit v1.8.0