| | |
| | | } |
| | | |
| | | /** |
| | | * 查询班制数据 |
| | | * |
| | | * @param equipmentid |
| | | * @param stringDates |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MdcDeviceCalendarVo> listByEquipmentAndDate(String equipmentid, List<String> stringDates) { |
| | | List<MdcDeviceCalendarVo> result = new ArrayList<>(); |
| | | try { |
| | | //查询默认班制 |
| | | List<MdcDeviceCalendarVo> acquiesceShift = this.baseMapper.findAcquiesceShift(); |
| | | |
| | | for (String stringDate : stringDates) { |
| | | List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = this.baseMapper.listByEquipmentAndDate(equipmentid, stringDate); |
| | | if (mdcDeviceCalendarVos != null && !mdcDeviceCalendarVos.isEmpty()) { |
| | | result.addAll(mdcDeviceCalendarVos); |
| | | } else { |
| | | acquiesceShift.forEach(mdcDeviceCalendarVo -> { |
| | | mdcDeviceCalendarVo.setEquipmentId(equipmentid); |
| | | mdcDeviceCalendarVo.setEffectiveDate(stringDate); |
| | | }); |
| | | // 设置默认班制 |
| | | result.addAll(acquiesceShift); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 获取一段时间范围内符合星期几的日期集合 |
| | | * |
| | | * @param startDate 开始时间 |