|  |  | 
 |  |  |     @Autowired | 
 |  |  |     private RmLossDayLastMapper rmLossDayLastMapper; | 
 |  |  |  | 
 |  |  |     @Value("${rtu.batteryVolt}") | 
 |  |  |     private Double batteryVolt; | 
 |  |  |  | 
 |  |  |     @Value("${rtu.signalIntensity.weak}") | 
 |  |  |     private Integer weak; | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @param qo | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoIntake>> getNotOnlineIntakes(CommonQO qo) { | 
 |  |  |         DecimalFormat df = new DecimalFormat("0.00"); | 
 |  |  |         /** | 
 |  |  |          * 补齐起止时间,如果开始时间为空,则默认为当前日期 | 
 |  |  |          */ | 
 |  |  |         String timeStart = qo.getTimeStart(); | 
 |  |  |         String timeStop = qo.getTimeStop(); | 
 |  |  |  | 
 |  |  |         if(timeStop != null) { | 
 |  |  |             timeStop = timeStop + " 23:59:59"; | 
 |  |  |             if(timeStart != null) { | 
 |  |  |                 timeStart = timeStart + " 00:00:00"; | 
 |  |  |             }else { | 
 |  |  |                 timeStart = LocalDate.now() + " 00:00:00"; | 
 |  |  |             } | 
 |  |  |         }else { | 
 |  |  |             timeStart = null; | 
 |  |  |         } | 
 |  |  |         qo.setTimeStart(timeStart); | 
 |  |  |         qo.setTimeStop(timeStop); | 
 |  |  |  | 
 |  |  |         // 生成查询参数 | 
 |  |  |     public QueryResultVo<List<VoIntake>> getNotOnlineIntakes(CommonQO qo, Long idStart, Long idEnd) { | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; | 
 |  |  |         params.put("idStart", idStart) ; | 
 |  |  |         params.put("idEnd", idEnd) ; | 
 |  |  |  | 
 |  |  |         // 获取符合条件的记录数 | 
 |  |  |         Long itemTotal = Optional.ofNullable(rmOnHourReportHistoryMapper.getNotOnlineIntakesCount(params)).orElse(0L); | 
 |  |  | 
 |  |  |  | 
 |  |  |         rsVo.calculateAndSet(itemTotal, params); | 
 |  |  |         rsVo.obj = rmOnHourReportHistoryMapper.getNotOnlineIntakes(params); | 
 |  |  |         return rsVo ; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 最近未报数的取水口 | 
 |  |  |      * @param qo | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoIntakeUnReported>> getUnReportedIntakes(CommonQO qo) { | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); | 
 |  |  |         Long itemTotal = rmOnHourReportLastMapper.getUnReportedIntakesCount(params); | 
 |  |  |  | 
 |  |  |         QueryResultVo<List<VoIntakeUnReported>> rsVo = new QueryResultVo<>() ; | 
 |  |  |         rsVo.pageSize = qo.pageSize ; | 
 |  |  |         rsVo.pageCurr = qo.pageCurr ; | 
 |  |  |  | 
 |  |  |         rsVo.calculateAndSet(itemTotal, params); | 
 |  |  |         rsVo.obj = rmOnHourReportLastMapper.getUnReportedIntakes(params); | 
 |  |  |         return rsVo ; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoBatteryVolt>> getUnderVoltIntakes(BatteryVoltQO qo) { | 
 |  |  |         qo.setBatteryVolt(batteryVolt); | 
 |  |  |         // 生成查询参数 | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取从未开过阀的取水口 | 
 |  |  |      * @param qo | 
 |  |  |      * @param idStart | 
 |  |  |      * @param idEnd | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(CommonQO qo) { | 
 |  |  |  | 
 |  |  |         String timeStart = qo.getTimeStart(); | 
 |  |  |         String timeStop = qo.getTimeStop(); | 
 |  |  |         if(timeStart != null && timeStart != "") { | 
 |  |  |             timeStart = timeStart + " 00:00:00"; | 
 |  |  |         } else { | 
 |  |  |             timeStart = LocalDate.now() + " 00:00:00"; | 
 |  |  |         } | 
 |  |  |         qo.setTimeStart(timeStart); | 
 |  |  |  | 
 |  |  |         if(timeStop != null && timeStop != "") { | 
 |  |  |             timeStop = timeStop + " 23:59:59"; | 
 |  |  |         }else { | 
 |  |  |             timeStop = LocalDate.now() + " 23:59:59"; | 
 |  |  |         } | 
 |  |  |         qo.setTimeStop(timeStop); | 
 |  |  |  | 
 |  |  |     public QueryResultVo<List<VoIntakeUnOpenValve>> getNeverOpenValveIntakes(CommonQO qo, Long idStart, Long idEnd) { | 
 |  |  |         // 生成查询参数 | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; | 
 |  |  |         params.put("idStart", idStart) ; | 
 |  |  |         params.put("idEnd", idEnd) ; | 
 |  |  |  | 
 |  |  |         // 获取符合条件的记录数 | 
 |  |  |         Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakesCount(params)).orElse(0L); | 
 |  |  |  | 
 |  |  |         QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ; | 
 |  |  |         QueryResultVo<List<VoIntakeUnOpenValve>> rsVo = new QueryResultVo<>() ; | 
 |  |  |  | 
 |  |  |         rsVo.pageSize = qo.pageSize ; | 
 |  |  |         rsVo.pageCurr = qo.pageCurr ; | 
 |  |  | 
 |  |  |         return rsVo ; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 最近未报数的取水口 | 
 |  |  |      * @param qo | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoIntakeUnReported>> getUnReportedIntakes(CommonQO qo) { | 
 |  |  |         String timeStart = qo.getTimeStart(); | 
 |  |  |         String timeStop = qo.getTimeStop(); | 
 |  |  |         if(timeStart == "") { | 
 |  |  |             timeStart = null; | 
 |  |  |         } | 
 |  |  |         if(timeStop == "") { | 
 |  |  |             timeStop = null; | 
 |  |  |         } | 
 |  |  |         if(timeStart != null && timeStart != "") { | 
 |  |  |             timeStart = timeStart + " 00:00:00"; | 
 |  |  |         } | 
 |  |  |         qo.setTimeStart(timeStart); | 
 |  |  |  | 
 |  |  |         if(timeStop != null && timeStop != "") { | 
 |  |  |             timeStop = timeStop + " 23:59:59"; | 
 |  |  |         } | 
 |  |  |         qo.setTimeStop(timeStop); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); | 
 |  |  |         Long itemTotal = rmOnHourReportLastMapper.getUnReportedIntakesCount(params); | 
 |  |  |  | 
 |  |  |         QueryResultVo<List<VoIntakeUnReported>> rsVo = new QueryResultVo<>() ; | 
 |  |  |         rsVo.pageSize = qo.pageSize ; | 
 |  |  |         rsVo.pageCurr = qo.pageCurr ; | 
 |  |  |  | 
 |  |  |         rsVo.calculateAndSet(itemTotal, params); | 
 |  |  |         rsVo.obj = rmOnHourReportLastMapper.getUnReportedIntakes(params); | 
 |  |  |         return rsVo ; | 
 |  |  |     } | 
 |  |  | } |