| | |
| | | @Transactional(readOnly = true) |
| | | public List<MdcEquipmentStatisticalShiftInfo> equipmentShiftStatisticalProcess(Equipment equipment, String dateTime) { |
| | | Date initDate = null; |
| | | List<String> stringDates = new ArrayList<>(); |
| | | Date endDate = DateUtils.plusTime(DateUtils.getNow(), 0); |
| | | //取最后的统计数据 |
| | | if (StringUtils.isBlank(dateTime)) { |
| | | MdcEquipmentStatisticalShiftInfo nearestDate = this.baseMapper.getMaxStaticsData(equipment.getEquipmentid()); |
| | |
| | | initDate = equipmentRunningSection.getStartTime(); |
| | | } |
| | | } |
| | | if (initDate == null) { |
| | | return null; |
| | | } |
| | | if (!DateUtils.less(initDate, endDate)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | //获取两个时间段的差 |
| | | stringDates = DateUtils.getDatesStringList2(initDate, DateUtils.plusTime(endDate, -1)); |
| | | if (stringDates.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | } |
| | | } else { |
| | | try { |
| | | initDate = DateUtils.toDate(dateTime, "yyyyMMdd"); |
| | |
| | | log.error("参数格式不对", null); |
| | | return null; |
| | | } |
| | | } |
| | | if (initDate == null) { |
| | | return null; |
| | | } |
| | | Date endDate = DateUtils.plusTime(DateUtils.getNow(), 0); |
| | | if (!DateUtils.less(initDate, endDate)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | //获取两个时间段的差 |
| | | List<String> stringDates = DateUtils.getDatesStringList2(initDate, DateUtils.plusTime(endDate, -1)); |
| | | if (stringDates.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | if (initDate == null) { |
| | | return null; |
| | | } |
| | | if (!DateUtils.less(initDate, endDate)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | stringDates.add(DateUtils.format(initDate, DateUtils.STRDATE)); |
| | | } |
| | | //查询班制班次信息 |
| | | Map<String, List<MdcDeviceCalendarVo>> listMap = this.mdcDeviceCalendarMap(equipment.getEquipmentid(), stringDates); |