pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java
@@ -5,10 +5,14 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.voSt.VoClient;
import com.dy.pipIrrGlobal.voSt.VoDayClient;
import com.dy.pipIrrGlobal.voSt.VoMonthClient;
import com.dy.pipIrrStatistics.client.qo.AmountSpentQO;
import com.dy.pipIrrStatistics.client.qo.OpenCountQO;
import com.dy.pipIrrStatistics.client.qo.WaterConsumptionQO;
import com.dy.pipIrrStatistics.client.qo.WaterDurationQO;
import com.dy.pipIrrStatistics.intake.qo.ClientAmountQO;
import com.dy.pipIrrStatistics.result.StatisticlResultCode;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -132,4 +136,43 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 统计指定月份各农户各天用水量及消费金额
     * @param qo
     * @return
     */
    @GetMapping(path = "/getDayAmountAndMoney")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoDayClient>>> getDayAmountAndMoney(ClientAmountQO qo) {
        if(qo.getYearMonth() == null) {
            return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage());
        }
        try {
            return BaseResponseUtils.buildSuccess(clientSv.getDayAmountAndMoney(qo));
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 统计指定年份各农户各月用水量及消费金额
     * @param qo
     * @return
     */
    @GetMapping(path = "/getMonthAmountAndMoney")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoMonthClient>>> getMonthAmountAndMoney(ClientAmountQO qo) {
        if(qo.getYear() == null) {
            return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage());
        }
        try {
            return BaseResponseUtils.buildSuccess(clientSv.getMonthAmountAndMoney(qo));
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}