From f0578816cd039cc16ec223d2b4e9383dde22cb3c Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期二, 06 八月 2024 09:09:52 +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 | 126 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 126 insertions(+), 0 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..24b04e4 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.IntakeQO; +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; @@ -30,6 +41,8 @@ public class IntakeSv { @Autowired private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper; + @Autowired + private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; @Autowired private RmOnHourReportLastMapper rmOnHourReportLastMapper; @@ -177,6 +190,119 @@ } /** + * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛 + * @return + */ + public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(IntakeQO 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