From b397edee2be2dfcc3f28eeac50298b4de26b1afa Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 13 十二月 2024 16:53:45 +0800
Subject: [PATCH] 取水口日取水量表中,出现一些大数,明显不正确,发析系统日志,发现一些阀控器会上报一些累计流量为0的数据,且无规律,推测是其不能从水表读取到累计流量时会上报0值。如果间歇上报0值,间歇上报一些非0值,非0值减去0值,就会出现大数,一天中出现几次那么会大数进行累加,数值将更大。为此变更算法,规避这种情况,但也会丢失一些流量值。
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/card/IcCardCtrl.java | 67 +++++++++++++++++++++++++++++++++
1 files changed, 67 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 bc0c9af..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
@@ -83,4 +89,65 @@
return BaseResponseUtils.buildException(e.getMessage());
}
}
+
+
+ /**
+ * 褰撳墠浣欓鎬婚噺锛堢墿鐞嗗崱锛�
+ *
+ * @param
+ * @return
+ */
+ @GetMapping(path = "/getTotalMoneyIcCards")
+ @SsoAop()
+ public BaseResponse<Double> getTotalMoneyIcCards() {
+ try {
+ Double res = icCardSv.getTotalMoneyIcCards();
+ return BaseResponseUtils.buildSuccess(res);
+ }catch (Exception e){
+ log.error("鑾峰彇璁板綍寮傚父", e);
+ 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