From d4c42dade56ff6c2bd5ca83819f8a8f56430e682 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 16 五月 2024 11:18:37 +0800 Subject: [PATCH] 问题反馈 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java | 88 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 75 insertions(+), 13 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java index 50938c4..6968763 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java @@ -2,18 +2,17 @@ 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; -import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; -import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; +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.*; import org.jeecg.modules.mdc.mapper.MdcHomeMapper; -import org.jeecg.modules.mdc.service.IEquipmentLogService; -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; import org.jeecg.modules.system.service.IMdcProductionService; +import org.jeecg.modules.system.service.ISysDictService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -33,13 +32,25 @@ private IMdcEquipmentService mdcEquipmentService; @Resource - private IEquipmentLogService equipmentLogService; + private IEquipmentService equipmentService; + + @Resource + private ISysDictService sysDictService; + + @Resource + private IEquipmentWorkLineService equipmentWorkLineService; @Resource private MdcHomeMapper mdcHomeMapper; @Resource private IMdcProductionService mdcProductionService; + + @Resource + private IEquipmentLogService equipmentLogService; + + @Resource + private IMdcFeedbackService mdcFeedbackService; /** * 璁惧杩愯鐘舵�佺粺璁� @@ -71,11 +82,12 @@ if (equipmentIdList == null || equipmentIdList.isEmpty()) { return result; } - List<EquipmentLog> logList = equipmentLogService.getEquipmentStatusList(equipmentIdList); - if (logList != null && !logList.isEmpty()) { - for (EquipmentLog equipmentLog : logList) { - if (equipmentLog.getOporation() != null) { - switch (equipmentLog.getOporation()) { +// List<EquipmentLog> logList = equipmentLogService.getEquipmentStatusList(equipmentIdList); + List<Equipment> equipmentList = equipmentService.list(new LambdaQueryWrapper<Equipment>().in(Equipment::getEquipmentid, equipmentIdList)); + if (equipmentList != null && !equipmentList.isEmpty()) { + for (Equipment equipment : equipmentList) { + if (equipment.getOporation() != null) { + switch (equipment.getOporation()) { case 1: case 2: mdcEquipmentStatusVo.setWaitCount(mdcEquipmentStatusVo.getWaitCount() + 1); @@ -371,6 +383,10 @@ */ @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); @@ -397,6 +413,10 @@ */ @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); @@ -443,4 +463,46 @@ public List<MdcEquipment> getEquipmentList(String key) { return mdcHomeMapper.getEquipmentList(key); } + + @Override + public MdcEquipmentDto getEquipmentDetails(String equipmentId) { + MdcEquipment mdcEquipment = mdcEquipmentService.getOne(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, equipmentId)); + List<DictModel> dictModelList = sysDictService.queryEnableDictItemsByCode(MdcConstant.SERIA_TYPE); + if (dictModelList != null && !dictModelList.isEmpty()) { + for (DictModel dictModel : dictModelList) { + if (dictModel.getValue().equals(mdcEquipment.getDriveType())) { + return null; + } + } + } + String saveTableName = mdcEquipment.getSaveTableName(); + MdcEquipmentDto dto = equipmentWorkLineService.getMacingDataList(saveTableName); + 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)); + } } -- Gitblit v1.9.3