|  |  | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.pipIrrGlobal.voSt.VoCardUsage; | 
 |  |  | import com.dy.pipIrrGlobal.voSt.VoICCard; | 
 |  |  | import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; | 
 |  |  | import com.dy.pipIrrStatistics.card.qo.CardUsageQO; | 
 |  |  | import jakarta.validation.Valid; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.validation.BindingResult; | 
 |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Objects; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @author ZhuBaoMin | 
 |  |  | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取指定时间段水卡使用情况:充值合计、消费合计、余额 | 
 |  |  |      * @param qo | 
 |  |  |      //* @param bindingResult | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "/card_usage") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoCardUsage>>> getCardUsages(@Valid CardUsageQO qo, BindingResult bindingResult) { | 
 |  |  |         if(bindingResult != null && bindingResult.hasErrors()){ | 
 |  |  |             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(icCardSv.getCardUsages(qo)); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取开卡记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()) ; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取售水总计信息:充值金额总计、水表消费金额总计 | 
 |  |  |      * @param qo | 
 |  |  |      * @param bindingResult | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "/total_water_use") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<Map> getTotalWaterUse(@Valid CardUsageQO qo, BindingResult bindingResult) { | 
 |  |  |         if(bindingResult != null && bindingResult.hasErrors()){ | 
 |  |  |             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(icCardSv.getTotalWaterUse(qo)); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取开卡记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()) ; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |