liurunyu
2025-01-09 f7b2aa672c00c2c35b08cdf19b8fa4bcad6df59d
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -38,26 +38,58 @@
public class IntkeCtrl {
    private final IntakeSv intakeSv;
    /**
    /** ok 111
     * 获取指定时间段内未上线的取水口
     * @param qo
     * @return
     */
    @GetMapping(path = "/getNotOnlineIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(@Valid CommonQO qo, BindingResult bindingResult) {
    public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(@Valid CommonQO qo, BindingResult bindingResult) throws Exception {
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        Long startId = null ;
        Long endId = null ;
        if(timeStart != null && !timeStart.trim().equals("")){
            int[] ymdStart = DateTime.yyyy_MM_dd_2_ymdGroup(timeStart) ;
            startId = IDLongGenerator.generateOneDayStartId(ymdStart[0], ymdStart[1], ymdStart[2]) ;
        }
        if(timeStop != null && !timeStop.trim().equals("")){
            int[] ymdEnd = DateTime.yyyy_MM_dd_2_ymdGroup(timeStop) ;
            endId = IDLongGenerator.generateOneDayStartId(ymdEnd[0], ymdEnd[1], ymdEnd[2]) ;
        }
        if(startId != null && endId != null){
            if(endId < startId){
                return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            }
        }
        try {
            return BaseResponseUtils.buildSuccess(intakeSv.getNotOnlineIntakes(qo));
            return BaseResponseUtils.buildSuccess(intakeSv.getNotOnlineIntakes(qo, startId, endId));
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /** ok 112
     * 最近未报数的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getUnReportedIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeUnReported>>> getUnReportedIntakes(CommonQO qo) {
        try {
            QueryResultVo<List<VoIntakeUnReported>> res = intakeSv.getUnReportedIntakes(qo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /** ok 1
     * 获取累计流量超过指定值的取水口
     * @param qo
@@ -559,20 +591,4 @@
        }
    }
    /**
     * 最近未报数的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getUnReportedIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeUnReported>>> getUnReportedIntakes(CommonQO qo) {
        try {
            QueryResultVo<List<VoIntakeUnReported>> res = intakeSv.getUnReportedIntakes(qo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}