| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.jeecg.modules.mdc.entity.EquipmentLog; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | |
| | | result.add(mdcCommonVo); |
| | | } |
| | | } |
| | | if (!result.isEmpty()) { |
| | | result.sort(Comparator.comparing(MdcCommonVo::getValue).reversed()); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | |
| | | String start = DateUtils.format(DateUtils.toDate(LocalDate.now().plusDays(-7).toString(), DateUtils.STR_DATE), DateUtils.STRDATE); |
| | | String end = DateUtils.format(DateUtils.toDate(LocalDate.now().plusDays(-1).toString(), DateUtils.STR_DATE), DateUtils.STRDATE); |
| | | if (equipmentIdList != null && !equipmentIdList.isEmpty()) { |
| | | result.put("equipmentIdList", equipmentIdList); |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().in(MdcEquipment::getEquipmentId, equipmentIdList)); |
| | | result.put("mdcEquipmentList", mdcEquipmentList); |
| | | List<MdcEquipmentStatisticalInfo> mdcEquipmentStatisticalInfoList = mdcHomeMapper.getEquipmentSevenUtilizationStatistics(equipmentIdList, start, end); |
| | | List<EquipmentDayUtilizationVo> dataList = new ArrayList<>(); |
| | | if (mdcEquipmentStatisticalInfoList != null && !mdcEquipmentStatisticalInfoList.isEmpty()) { |
| | |
| | | if (BigDecimal.ZERO.compareTo(processLong) == -1) { |
| | | mdcHomeEquipmentVo.setUtilizationRate(processLong.divide(processDay.multiply(new BigDecimal("86400")), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | if (BigDecimal.ZERO.compareTo(openLong) == -1) { |
| | | mdcHomeEquipmentVo.setStartRate(openLong.divide(new BigDecimal("864"), 4, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); |
| | | mdcHomeEquipmentVo.setStartRate(openLong.divide(new BigDecimal("86400"), 4, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); |
| | | mdcHomeEquipmentVo.setOpenRate(processDay.divide(openLong, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | } |
| | | } |