| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.board.vo.EquDowntimeInfo; |
| | | import org.jeecg.modules.mdc.dto.MdcDowntimeDto; |
| | | import org.jeecg.modules.mdc.entity.MdcDowntime; |
| | | import org.jeecg.modules.mdc.mapper.MdcDowntimeMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcDowntimeService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.MdcDowntimeVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<MdcDowntime> pageList(String userId, Page<MdcDowntime> page, MdcDowntimeVo mdcDowntimeVo, HttpServletRequest req) { |
| | | public IPage<MdcDowntimeDto> pageList(String userId, Page<MdcDowntimeDto> page, MdcDowntimeVo mdcDowntimeVo, HttpServletRequest req) { |
| | | // 获取设备ID列表 |
| | | List<String> equipmentIds = getEquipmentIds(userId, mdcDowntimeVo); |
| | | |
| | |
| | | return this.baseMapper.pageList(page, mdcDowntimeVo); |
| | | } |
| | | |
| | | @Override |
| | | public Integer findPlanTimeDuration(String equipmentId, String validDate, String closeType) { |
| | | int result = 0; |
| | | List<MdcDowntime> mdcDowntimeList = this.baseMapper.findPlanTimeDuration(equipmentId, validDate, closeType); |
| | | if (mdcDowntimeList != null && !mdcDowntimeList.isEmpty()) { |
| | | for (MdcDowntime mdcDowntime : mdcDowntimeList) { |
| | | result = DateUtils.differentMinutes(mdcDowntime.getStartDate(), mdcDowntime.getEndDate()) + result; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<EquDowntimeInfo> equDowntimeStatistics(List<String> equipmentIdList, String start, String end) { |
| | | return this.baseMapper.equDowntimeStatistics(equipmentIdList, start, end); |
| | | } |
| | | |
| | | private List<String> getEquipmentIds(String userId, MdcDowntimeVo mdcDowntimeVo) { |
| | | if (StringUtils.isNotEmpty(mdcDowntimeVo.getEquipmentId())) { |
| | | return Collections.singletonList(mdcDowntimeVo.getEquipmentId()); |