| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.mapper.MdcDeviceCalendarMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcDeviceCalendarService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcShiftSubService; |
| | | import org.jeecg.modules.mdc.service.IMdcVacationManagementService; |
| | | import org.jeecg.modules.mdc.service.*; |
| | | import org.jeecg.modules.mdc.vo.EquipmentCalendarVo; |
| | | import org.jeecg.modules.mdc.vo.MdcDeviceCalendarQueryVo; |
| | | import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo; |
| | |
| | | |
| | | @Resource |
| | | private IMdcVacationManagementService mdcVacationManagementService; |
| | | |
| | | @Resource |
| | | private IMdcEquipmentOvertimeService mdcEquipmentOvertimeService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | */ |
| | | @Override |
| | | public List<MdcDeviceCalendarVo> listByEquipmentAndDate(String equipmentId, List<String> stringDates) { |
| | | List<MdcDeviceCalendarVo> result = new ArrayList<>(); |
| | | try { |
| | | for (String stringDate : stringDates) { |
| | | List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = this.baseMapper.listByEquipmentAndDate(equipmentId, stringDate); |
| | | if (mdcDeviceCalendarVos != null && !mdcDeviceCalendarVos.isEmpty()) { |
| | | result.addAll(mdcDeviceCalendarVos); |
| | | } |
| | | List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = this.baseMapper.listByEquipmentAndDates(equipmentId, stringDates); |
| | | if (mdcDeviceCalendarVos != null && !mdcDeviceCalendarVos.isEmpty()) { |
| | | return mdcDeviceCalendarVos; |
| | | } else { |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | public BigDecimal computeShiftTimeCount(String equipmentId, String validDate) { |
| | | validDate = validDate.replaceAll("-", ""); |
| | | Integer shiftCount = this.baseMapper.computeShiftTimeCount(equipmentId, validDate); |
| | | return new BigDecimal(shiftCount).multiply(new BigDecimal("8")).multiply(new BigDecimal("60")); |
| | | return new BigDecimal(shiftCount); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public List<MdcDeviceCalendarVo> listByEquipmentIdAndDate(String equipmentId, String date) { |
| | | return this.baseMapper.listByEquipmentAndDate(equipmentId, date); |
| | | List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = this.baseMapper.listByEquipmentAndDate(equipmentId, date); |
| | | if (mdcDeviceCalendarVos != null && !mdcDeviceCalendarVos.isEmpty()) { |
| | | for (MdcDeviceCalendarVo mdcDeviceCalendarVo : mdcDeviceCalendarVos) { |
| | | List<MdcEquipmentOvertime> list = mdcEquipmentOvertimeService.list(new LambdaQueryWrapper<MdcEquipmentOvertime>().eq(MdcEquipmentOvertime::getEquipmentId, mdcDeviceCalendarVo.getEquipmentId()).eq(MdcEquipmentOvertime::getTheDate, mdcDeviceCalendarVo.getEndDate())); |
| | | if (list != null && !list.isEmpty()) { |
| | | mdcDeviceCalendarVo.setOvertimeStartTime(list.get(0).getStartTime()); |
| | | mdcDeviceCalendarVo.setOvertimeEndTime(list.get(0).getEndTime()); |
| | | } |
| | | } |
| | | } |
| | | return mdcDeviceCalendarVos; |
| | | } |
| | | |
| | | } |