| | |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.mdc.constant.MdcConstant; |
| | | import org.jeecg.modules.mdc.dto.MdcEquipmentDto; |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; |
| | | import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.mapper.MdcHomeMapper; |
| | | import org.jeecg.modules.mdc.service.IEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IEquipmentWorkLineService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcHomeService; |
| | | import org.jeecg.modules.mdc.service.*; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | |
| | | |
| | | @Resource |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | @Resource |
| | | private IEquipmentLogService equipmentLogService; |
| | | |
| | | @Resource |
| | | private IMdcFeedbackService mdcFeedbackService; |
| | | |
| | | /** |
| | | * 设备运行状态统计 |
| | |
| | | */ |
| | | @Override |
| | | public MdcHomeEfficiencyVo getEquipmentLevelEfficiencyStatistics(String equipmentId) { |
| | | MdcEquipment mdcEquipment = mdcEquipmentService.getOne(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, equipmentId)); |
| | | if (mdcEquipment == null) { |
| | | return null; |
| | | } |
| | | MdcHomeEfficiencyVo result = new MdcHomeEfficiencyVo(); |
| | | String date = DateUtils.format(DateUtils.toDate(LocalDate.now().plusDays(-1).toString(), DateUtils.STR_DATE), DateUtils.STRDATE); |
| | | MdcEquipmentStatisticalInfo mdcEquipmentStatisticalInfo = mdcHomeMapper.getUtilizationByDay(Arrays.asList(equipmentId.split(",")), date); |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> getEquipmentAnnualEfficiencyStatistics(String equipmentId) { |
| | | MdcEquipment mdcEquipment = mdcEquipmentService.getOne(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, equipmentId)); |
| | | if (mdcEquipment == null) { |
| | | return null; |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | Date end = DateUtils.toDate(LocalDate.now().plusMonths(-1).toString(), DateUtils.STR_DATE); |
| | | Date start = DateUtils.toDate(LocalDate.now().plusMonths(-12).toString(), DateUtils.STR_DATE); |
| | |
| | | } |
| | | String saveTableName = mdcEquipment.getSaveTableName(); |
| | | MdcEquipmentDto dto = equipmentWorkLineService.getMacingDataList(saveTableName); |
| | | if ("LSV2".equals(mdcEquipment.getDriveType())) { |
| | | dto.setSpindlebeilv(dto.getSFeed()); |
| | | dto.setFeedbeilv(dto.getFFeed()); |
| | | dto.setRapidfeed(dto.getRapidfeed()); |
| | | dto.setNCVersion(dto.getNCVersion()); |
| | | dto.setTNCVersion(dto.getTNCVersion()); |
| | | dto.setOPTVersion(dto.getOPTVersion()); |
| | | dto.setPLCVersion(dto.getPLCVersion()); |
| | | if (dto != null) { |
| | | if ("LSV2".equals(mdcEquipment.getDriveType())) { |
| | | dto.setSpindlebeilv(dto.getSFeed()); |
| | | dto.setFeedbeilv(dto.getFFeed()); |
| | | dto.setRapidfeed(dto.getRapidfeed()); |
| | | dto.setNCVersion(dto.getNCVersion()); |
| | | dto.setTNCVersion(dto.getTNCVersion()); |
| | | dto.setOPTVersion(dto.getOPTVersion()); |
| | | dto.setPLCVersion(dto.getPLCVersion()); |
| | | } |
| | | // 查询设备状态 |
| | | EquipmentLog equipmentLog = equipmentLogService.selectEquipmentOporation(mdcEquipment.getEquipmentId()); |
| | | Integer oporation = equipmentLog.getOporation(); |
| | | if (oporation == 22) { |
| | | dto.setALRMstate(equipmentLog.getAlarm()); |
| | | } else { |
| | | dto.setALRMstate("无"); |
| | | } |
| | | } else { |
| | | return null; |
| | | } |
| | | return dto; |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcFeedback> getFeedbackList(String key) { |
| | | return mdcFeedbackService.list(new LambdaQueryWrapper<MdcFeedback>().eq(MdcFeedback::getProductionId, key).orderByDesc(MdcFeedback::getCreateTime)); |
| | | } |
| | | } |