From caf57c76275bae0a2d6e81c27bdb0f4f77b7739a Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期二, 06 八月 2024 10:49:04 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java | 128 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 127 insertions(+), 1 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java index c248646..0bc6f0d 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java @@ -2,10 +2,21 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper; +import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper; import com.dy.pipIrrGlobal.daoRm.RmOnHourReportLastMapper; import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper; 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.VoIntakeOpenCount; +import com.dy.pipIrrGlobal.voSt.VoSignalIntensity; +import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO; +import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO; +import com.dy.pipIrrStatistics.intake.qo.CommonQO; +import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO; +import com.dy.pipIrrStatistics.intake.qo.SignalIntensityQO; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -31,6 +42,8 @@ @Autowired private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper; @Autowired + private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; + @Autowired private RmOnHourReportLastMapper rmOnHourReportLastMapper; @Autowired @@ -50,7 +63,7 @@ * @param qo * @return */ - public QueryResultVo<List<VoIntake>> getNotOnlineIntakes(IntakeQO qo) { + public QueryResultVo<List<VoIntake>> getNotOnlineIntakes(CommonQO qo) { DecimalFormat df = new DecimalFormat("0.00"); /** * 琛ラ綈璧锋鏃堕棿锛屽鏋滃紑濮嬫椂闂翠负绌猴紝鍒欓粯璁や负褰撳墠鏃ユ湡 @@ -177,6 +190,119 @@ } /** + * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛 + * @return + */ + public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(CommonQO qo) { + + String timeStart = qo.getTimeStart(); + String timeStop = qo.getTimeStop(); + if(timeStart != null) { + timeStart = timeStart + " 00:00:00"; + }else { + timeStart = LocalDate.now() + " 00:00:00"; + } + qo.setTimeStart(timeStart); + if(timeStop != null) { + timeStop = timeStop + " 23:59:59"; + }else { + timeStop = LocalDate.now() + " 23:59:59"; + } + qo.setTimeStop(timeStop); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakesCount(params)).orElse(0L); + + QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakes(params); + return rsVo ; + } + + /** + * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙� + * @param qo + * @return + */ + public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveGtIntakes(IntakeValueQO qo) { + + String timeStart = qo.getTimeStart(); + String timeStop = qo.getTimeStop(); + if(timeStart != null) { + timeStart = timeStart + " 00:00:00"; + }else { + timeStart = LocalDate.now() + " 00:00:00"; + } + qo.setTimeStart(timeStart); + if(timeStop != null) { + timeStop = timeStop + " 23:59:59"; + }else { + timeStop = LocalDate.now() + " 23:59:59"; + } + qo.setTimeStop(timeStop); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveGtIntakesCount(params)).orElse(0L); + + QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveGtIntakes(params); + return rsVo ; + } + + /** + * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙� + * @param qo + * @return + */ + public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveLtIntakes(IntakeValueQO qo) { + + String timeStart = qo.getTimeStart(); + String timeStop = qo.getTimeStop(); + if(timeStart != null) { + timeStart = timeStart + " 00:00:00"; + }else { + timeStart = LocalDate.now() + " 00:00:00"; + } + qo.setTimeStart(timeStart); + if(timeStop != null) { + timeStop = timeStop + " 23:59:59"; + }else { + timeStop = LocalDate.now() + " 23:59:59"; + } + qo.setTimeStop(timeStop); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveLtIntakesCount(params)).orElse(0L); + + QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveLtIntakes(params); + return rsVo ; + } + + /** * 鏍规嵁寮�闃�绫诲瀷鑾峰彇鎿嶄綔娆℃暟 * @param qo * @return -- Gitblit v1.8.0