| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voSt.VoClient; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientOpenCardCount; |
| | | import com.dy.pipIrrGlobal.voSt.VoICCard; |
| | | import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; |
| | | 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 jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(clientSv.getLargeOpenCountClients(qo)); |
| | | } catch (Exception e) { |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取指定时间段内开阀次数低于指定值的农户 |
| | | * @param qo |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getSmallOpenCountClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> getSmallOpenCountClients(@Valid OpenCountQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(clientSv.getSmallOpenCountClients(qo)); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取指定时间段内用水量超过指定值的农户 |
| | | * @param qo |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getLargeWaterConsumptionClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> getLargeWaterConsumptionClients(@Valid WaterConsumptionQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(clientSv.getLargeWaterConsumptionClients(qo)); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取指定时间段内消费金额超过指定值的农户 |
| | | * @param qo |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getLargeAmountSpentClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> getLargeAmountSpentClients(@Valid AmountSpentQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(clientSv.getLargeAmountSpentClients(qo)); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取指定时间段内用水时长超过指定值的农户 |
| | | * @param qo |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getLargeWaterDurationClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> getLargeWaterDurationClients(@Valid WaterDurationQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(clientSv.getLargeWaterDurationClients(qo)); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内开物理卡农户 |
| | | * |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getOpenIcCardClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClientOpenCardCount>>> getOpenIcCardClients(CommonQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoClientOpenCardCount>> res = clientSv.getOpenIcCardClients(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | }catch (Exception e){ |
| | | log.error("获取记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |