From bc352eb500297445631fb02351e0c64e09631a3d Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期四, 08 八月 2024 11:08:10 +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 | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 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 4dbc9b0..74b0257 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 @@ -1,22 +1,9 @@ package com.dy.pipIrrStatistics.intake; 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.daoRm.*; 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.IntakeCountValueQO; -import com.dy.pipIrrStatistics.intake.qo.CommonQO; -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; @@ -25,6 +12,8 @@ import java.text.DecimalFormat; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.Optional; @@ -45,9 +34,11 @@ private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; @Autowired private RmOnHourReportLastMapper rmOnHourReportLastMapper; - @Autowired private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper; + + @Autowired + private RmIntakeAmountDayMapper rmIntakeAmountDayMapper; @Value("${rtu.batteryVolt}") private Double batteryVolt; @@ -649,4 +640,32 @@ rsVo.obj = rmOpenCloseValveHistoryMapper.getNoOpenHaveCloseIntakes(params); return rsVo ; } + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫ぉ鐢ㄦ按閲� + * @param qo + * @return + */ + public QueryResultVo<List<VoDayIntakeAmount>> getDayIntakeAmount(DayIntakeAmountQO qo) { + Calendar calendar = Calendar.getInstance(); + Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR)); + Integer month = Optional.ofNullable(qo.getMonth()).orElse(calendar.get(Calendar.MONTH)); + qo.setYear(year); + qo.setMonth(month); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmIntakeAmountDayMapper.getDayIntakeAmountCount(params)).orElse(0L); + + QueryResultVo<List<VoDayIntakeAmount>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmIntakeAmountDayMapper.getDayIntakeAmount(params); + return rsVo ; + } } -- Gitblit v1.8.0