| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import org.jeecg.common.api.CommonAPI; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus; |
| | | import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum; |
| | | import org.jeecg.modules.eam.constant.EquipmentRepairStatus; |
| | | import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; |
| | | import org.jeecg.modules.mdc.constant.MdcConstant; |
| | | import org.jeecg.modules.mdc.dto.EamEquipmentExtendDto; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.mapper.MdcBoardMapper; |
| | |
| | | |
| | | @Resource |
| | | private MdcBoardMapper mdcBoardMapper; |
| | | |
| | | @Resource |
| | | private IMdcDeviceCalendarService mdcDeviceCalendarService; |
| | | |
| | | /** |
| | | * 设备状态 |
| | |
| | | mdcBoardRateVo.setOpenRate(equipmentStatisticalInfo.getOpenLong().divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | if (equipmentStatisticalInfo.getOpenLong().compareTo(BigDecimal.ZERO) > 0) { |
| | | mdcBoardRateVo.setStartRate(equipmentStatisticalInfo.getProcessLong().multiply(new BigDecimal("100").divide(equipmentStatisticalInfo.getOpenLong(), 2, RoundingMode.HALF_UP))); |
| | | mdcBoardRateVo.setStartRate(equipmentStatisticalInfo.getProcessLong().multiply(new BigDecimal("100")).divide(equipmentStatisticalInfo.getOpenLong(), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | statisticsMap.put(date, mdcBoardRateVo); |
| | | } |
| | |
| | | String realName = commonAPI.translateDictFromTable("sys_user", "realname", "username", mdcBoardEquRealTImeVo.getEquipmentManager()); |
| | | mdcBoardEquRealTImeVo.setEquipmentManager(realName); |
| | | mdcBoardEquRealTImeVo.setAlarm("无"); |
| | | if (mdcBoardEquRealTImeVo.getOporation() != null) { |
| | | switch (mdcBoardEquRealTImeVo.getOporation()) { |
| | | if (mdcBoardEquRealTImeVo.getOperation() != null) { |
| | | switch (mdcBoardEquRealTImeVo.getOperation()) { |
| | | case 1: |
| | | case 2: |
| | | mdcBoardEquRealTImeVo.setOporationDict("待机"); |
| | |
| | | } |
| | | } else { |
| | | mdcBoardEquRealTImeVo.setOporationDict("关机"); |
| | | mdcBoardEquRealTImeVo.setOporation(0); |
| | | mdcBoardEquRealTImeVo.setOperation(0); |
| | | } |
| | | //设备运行数据 |
| | | Map<String, Object> mapData = equipmentWorkLineService.getDataList(mdcBoardEquRealTImeVo.getSaveTableName()); |
| | | if (mapData != null) { |
| | | if (mapData.containsKey("Sequencenumber")) { |
| | | Object object = mapData.get("Sequencenumber"); |
| | | mdcBoardEquRealTImeVo.setSequenceNumber(object == null ? "" : object.toString()); |
| | | mdcBoardEquRealTImeVo.setSequenceNumber(object == null || "关机".equals(mdcBoardEquRealTImeVo.getOporationDict()) ? "" : object.toString()); |
| | | } |
| | | if (mapData.containsKey("spindlespeed")) { |
| | | Object object = mapData.get("spindlespeed"); |
| | | mdcBoardEquRealTImeVo.setSpindleSpeed(object == null ? "" : object.toString()); |
| | | if (mapData.containsKey("actualspindlespeed")) { |
| | | Object object = mapData.get("actualspindlespeed"); |
| | | mdcBoardEquRealTImeVo.setSpindleSpeed(object == null || "关机".equals(mdcBoardEquRealTImeVo.getOporationDict()) ? "" : object.toString()); |
| | | } |
| | | if (mapData.containsKey("spindleload")) { |
| | | Object object = mapData.get("spindleload"); |
| | | mdcBoardEquRealTImeVo.setSpindleLoad(object == null ? "" : object.toString()); |
| | | mdcBoardEquRealTImeVo.setSpindleLoad(object == null || "关机".equals(mdcBoardEquRealTImeVo.getOporationDict()) ? "" : object.toString()); |
| | | } |
| | | if (mapData.containsKey("spindlebeilv")) { |
| | | Object object = mapData.get("spindlebeilv"); |
| | | mdcBoardEquRealTImeVo.setSpindlebeilv(object == null ? "" : object.toString()); |
| | | mdcBoardEquRealTImeVo.setSpindlebeilv(object == null || "关机".equals(mdcBoardEquRealTImeVo.getOporationDict()) ? "" : object.toString()); |
| | | } |
| | | if (mapData.containsKey("feedbeilv")) { |
| | | Object object = mapData.get("feedbeilv"); |
| | | mdcBoardEquRealTImeVo.setFeedbeilv(object == null ? "" : object.toString()); |
| | | mdcBoardEquRealTImeVo.setFeedbeilv(object == null || "关机".equals(mdcBoardEquRealTImeVo.getOporationDict()) ? "" : object.toString()); |
| | | } |
| | | } |
| | | // 维保状态 |
| | |
| | | } else { |
| | | mdcBoardEquRealTImeVo.setReportRepairStatus("无"); |
| | | } |
| | | // 下次点检下次保养 |
| | | // 班次 |
| | | String shift = mdcDeviceCalendarService.findShiftByEquId(equipmentId); |
| | | if (StringUtils.isNotBlank(shift)) { |
| | | mdcBoardEquRealTImeVo.setShift(shift); |
| | | } |
| | | // 点检 保养 |
| | | Date nextInspection = mdcBoardMapper.findInsOrMain(equipmentId, MaintenanceCategoryEnum.POINT_INSPECTION.name()); |
| | | if (nextInspection != null) { |
| | | mdcBoardEquRealTImeVo.setNextInspection(nextInspection); |